[syslog-ng] How to assign specific value in a pattern

C. L. Martinez carlopmart at gmail.com
Wed Mar 26 09:51:02 CET 2014


Hi all,

 I need to assign a specific value to only one pattern inside a
ruleset with multiple patterns. For example, I have defined the
following patterns for one ruleset:

<ruleset name="kernel" id='1002'>
                <pattern>kernel</pattern>
                <rules>
                        <rule provider="By me" class='1002' id='1002'>
                                <patterns>
                                        <pattern>pattern1</pattern>
                                        <pattern>pattern2</pattern>
                                        <pattern>pattern3</pattern>
                                </patterns>
                        </rule>
                </rules>
 </ruleset>


The I need to do the following:

<ruleset name="kernel" id='1002'>
                <pattern>kernel</pattern>
                <rules>
                        <rule provider="By me" class='1002' id='1002'>
                                <patterns>
                                        <pattern>pattern1</pattern>
                                        <pattern>pattern2</pattern>
                                              <values>
                                                   <value
name="mytestvalue">Downloaded file</value>
                                               </values>
                                        <pattern>pattern3</pattern>
                                </patterns>
                        </rule>
                </rules>
 </ruleset>

As you can see I need to assign "Downloaded file" value to
"mytestvalue" but only for pattern2 and not the others ...

At this time, value "mytestvalue" is assigned to all patterns ... Is
it possible to do this??


More information about the syslog-ng mailing list