Closed GoogleCodeExporter closed 9 years ago
That's an interesting challenge. There are a number of ways to do what you're
trying to do, but none of them are particularly easy. Let's try to make the
method you've started to do work. The best thing to do when trying to
troubleshoot a parser is to use contrib/livetail.pl to monitor the incoming
messages as they are parsed. That utility will print the messages as they
appear to the elsa.pl script that normalizes and eventually sends logs to the
indexer. You can change merged.xml then without restarting syslog-ng to watch
the changes.
Note that it is merged.xml, not patterndb.xml that syslog-ng reads. Custom
patterns are meant to be put in /etc/elsa/patterns.d, and then the install.sh
script will merge those patterns with stock ELSA patterns into the
/usr/local/elsa/node/conf/merged.xml file, which is what syslog-ng actually
uses.
I believe your field_order is wrong for the newly added "key" field. It should
be field_order 11 (s0) and not 5 (i0).
Original comment by mchol...@gmail.com
on 17 Sep 2013 at 2:37
Thanks for your reply. I will give it a try. I have a question before I do,
though: are the field_order values documented anywhere? The documentation
points to $Field_order in web/lib/API.pm, but I don't see that in that file.
Original comment by ruvi...@gmail.com
on 17 Sep 2013 at 1:37
Check out the top of the elsa/web/lib/Fields.pm file which lays those out.
Original comment by mchol...@gmail.com
on 19 Sep 2013 at 2:10
Thanks! I was able to get my custom snort parsers to work. The problems were as
you suggested: the merged.xml file wasn't being modified, and my field_order
was wrong.
If I could turn back to my more general question, is there a way to parse out
my field in all messages (like the generic hostname and program fields)?
Original comment by ruvi...@gmail.com
on 24 Sep 2013 at 12:00
Glad to hear it's working. No, there's no good way to parse that field out
from all messages without creating a parser for every kind of message you would
receive.
Original comment by mchol...@gmail.com
on 27 Sep 2013 at 3:00
Original issue reported on code.google.com by
ruvi...@gmail.com
on 15 Sep 2013 at 10:59