[syslog-ng] advice/assistance with parsing attempt requested

Bill Anderson Bill.Anderson at bodybuilding.com
Mon Dec 6 15:38:13 CET 2010


On Dec 6, 2010, at 4:18 AM, <syslog-ng2010 at hushmail.com> wrote:

> i've spent the better part of the past week reading and trying to 
> understand both the documentation and list posts trying to sort 
> this out, if anyone can offer some advice as to whether this is 
> possible or not and if so, what i'm doing wrong; i would really 
> appreciate it! …
> 
> i have a simple enough task, or so i thought! i've got a syslog 
> stream being received by syslog-ng with too much data. what i'd 
> like to do is parse out pieces of the stream and write only those 
> to a file. the tricky part is that the order of the stream is very 
> variable so that sometimes the desired named parser preceding 
> strings and associated values are present and sometimes not. 
> furthermore, the extra data is also quite variable. can this 
> challenge even be addressed with syslog-ng ose? if so, can it be 
> done with patterned without creating a pattern for EVERY variation 
> of possible streams?

I believe you can use the parser and filter in combination to log on match essentially. With this you would only need to set up patterns for the possible combinations you actually want to log/reduce. 

> for clarification, we've tried to leverage an 
> external perl script which does this using regexs but, it seems 
> that it can't keep up with the stream, we only receive 10% of the 
> original events in the output. if this (external parsing script) 
> only way this can be done, we will continue our efforts to enhance 
> the external script but, if this is possible to be done natively 
> within syslog-ng, i'd rather do that.

What is the volume of events here per-second and per-minute? Perl may not be the right tool for the job here (assuming you can't get it done natively in syslog-ng). If there are too many patterns for you to create you might consider sending the base matches for this to an external daemon that processes them and sends them back into syslog for storage. Then again, I'd be weighing the cost of patterns vs. external script or daemon. How much time to imply input the patterns? If you can do it in a script, you can have the script write your patterndb file for starters. Then there is the cost of adding new entries when they come around (assuming they do) vs. adding to the code.

Another option, if you don't want to keep the extras might be to use a rewrite rule to remove extra1=extravalue1 prior to running the parser.


Cheers,
Bill

--
Bill Anderson, RHCE
Linux Systems Engineer
bill.anderson at bodybuilding.com





More information about the syslog-ng mailing list