Created
June 18, 2015 18:19
-
-
Save taotetek/7a26d5eec830dd942b75 to your computer and use it in GitHub Desktop.
proof of concept for dynamic template output on actions
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| module ( | |
| load="imtcp" | |
| ) | |
| input(type="imtcp" port="514" ruleset="test_dynamic") | |
| template(name="had_cee" type="list") { | |
| constant(value="CEE WOOT WOOT: ") | |
| property(name="msg") | |
| } | |
| template(name="no_cee" type="list") { | |
| constant(value="NO CEE SADFACE: ") | |
| property(name="msg") | |
| } | |
| template(name="manual" type="list") { | |
| property(name="$.custom") | |
| constant(value="\n") | |
| } | |
| ruleset(name="test_dynamic") { | |
| if $msg contains 'cee:' then { | |
| set $.custom = exec_template("had_cee"); | |
| } else { | |
| set $.custom = exec_template("no_cee"); | |
| } | |
| action( | |
| name="dynamic_template_to_file" | |
| type="omfile" | |
| file="/var/log/testdynamic.log" | |
| template="manual" | |
| ) | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment