-
-
Notifications
You must be signed in to change notification settings - Fork 53
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Can't create an expressión filter with more than one 'else if' #164
Comments
I have found that coding the yaml like: - expression_filter:
filter:
if:
expression: '$hostname == ["sip", "proxysipint", "proxysipintb" ]'
tasks:
- set:
'$.filename': '"kam-int.log"'
"# else if 1\nelse if":
expression: '$hostname == ["sipext", "proxysipext" ]'
tasks:
- set:
'$.filename': '"kam-ext.log"'
"# else if 2\nelse if":
expression: '$hostname == ["pbxum", "pbxum1", "pbxum1b"]'
tasks:
- set:
'$.filename': '"ast-core.log"' worarounds the problem, but I can't find a better way |
I'll take a look at what I can do. I have some ideas. |
@amateo I pushed an update to master that changes how the expression filter YAML is formatted a little. It is still compatible with current formats, it just is designed to address the issue you ran into. Your workaround gave me the idea to name the conditions rather than try and rely on users putting the see https://github.com/voxpupuli/puppet-rsyslog#expression-based-filters for some updated examples I am planning on pushing up a release to the puppet forge either tonight or tomorrow if you'd rather wait for that than pull from git. |
Thank you @dhollinger, I'll try it as soon as the new release is published. |
@dhollinger, have you released it in the forge? |
@amateo Not yet, will be before the end of the day (local time) |
@amateo The release should be live now |
Ok. Thank you. |
Hi,
I need to create a ruleset with a rule with an expression with more than just one
else if
. Somethin like:So, my code is like:
the problem with this hiera is that I have to use the same
else if
key for two different hash elements, so the second overrides the first.I've been looking for a way to create such an expression, but as the template for an expression is:
I can't find any way to do it, because the conditional clause is taken always from the key of the element in the hash.
Is there any way to create such config?
The text was updated successfully, but these errors were encountered: