Server Fault is a question and answer site for system and network administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

In a similar vein to my previous question regarding syslog-ng's patterndb patterns to match an empty description, I am now trying to match "--MARK--" messages. The messages look like this:

-- MARK --

Their ${PROGRAM} is apparently set to null/blank. I currently have the following XML for my ruleset, which doesn't match the messages:

<ruleset name='my-null' id='my-null'>

    <rule class='system' id='null_dashed_mark' provider='me'>
        <pattern>-- MARK --</pattern>
        <test_message program="">-- MARK --</test_message>

I have also tried various combinations of newlines and spaces between <pattern> and </pattern>, to no avail.

So how can I construct my ruleset specification to match/catch these "MARK" messages?

share|improve this question
-- MARK -- is output by syslog, and easily configurable to go away. Why would you want to match it ? – adaptr Feb 14 '12 at 15:41
I am tagging every log message so I can apply "artificial ignorance". I want to keep "--MARK--" messages because they're useful, but I'm still going to need to tag them. Also, it is conceivable that other possibly-malformed log messages would arrive with an empty/blank ${PROGRAM}, so this would be useful in those cases as well. – EdwardTeach Feb 14 '12 at 16:00
up vote 3 down vote accepted

omit the <pattern> element of the ruleset, then syslog-ng should match the rules of this ruleset for messages without a PROGRAM field.



share|improve this answer
This worked great; thanks again! – EdwardTeach Feb 14 '12 at 22:34

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.