Skip to content

Instantly share code, notes, and snippets.

@siliconbrain
Last active September 22, 2017 08:24
Show Gist options
  • Save siliconbrain/4790de2362ed8aca9af878297dfecbf9 to your computer and use it in GitHub Desktop.
Save siliconbrain/4790de2362ed8aca9af878297dfecbf9 to your computer and use it in GitHub Desktop.
syslog-ng python patterndb bug
<?xml version='1.0' encoding='UTF-8'?>
<patterndb version='4' pub_date='2017-09-21'>
<ruleset name='python_template_test' id='fab7ae24-5a2b-43a9-9ad6-39bc6c82a15b'>
<pattern>myprg</pattern>
<rules>
<rule id='ID:minimal_pattern' provider='user' class='CLS:minimal_pattern'>
<patterns>
<pattern>Some test value: @ESTRING:some_test_value:.@</pattern>
</patterns>
<tags></tags>
<values></values>
<examples>
<example>
<test_message program='myprg'>Some test value: macilaci.</test_message>
<test_values>
<test_value name='some_test_value'>macilaci</test_value>
</test_values>
</example>
</examples>
</rule>
</rules>
</ruleset>
</patterndb>
myprg Some test value: lacika.
python {
def this_is_where_the_segfault_happens(log_msg):
return log_msg['some_test_value']
};
log {
source { file("/etc/syslog-ng/conf.d/python-bug-test-file"); };
parser { db-parser(file("/etc/syslog-ng/conf.d/python-bug-pattern.xml")); };
destination { file("/dev/null" template("$(python this_is_where_the_segfault_happens)\n")); };
};
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment