I'm having an issue with an Infoblox filter I'm working on. As I can't use the default syslog filter, I have to use tcp input. This is working fine except for one part and that is the severity_label not being available. I suppose I have to use this plugin: https://www.elastic.co/guide/en/logstash/current/plugins-filters-syslog_pri.html#plugins-filters-syslog_pri
But I don't really get it to work.
An example message that should have a informational severity_label =>
<134>Jul 15 08:53:58 10.23.17.250 dhcpd[10639]: DHCPACK to 10.23.136.206 (f8:b1:56:de:be:4d) via eth2
And another that should have an error severity_label =>
<131>Jul 15 08:53:58 10.15.17.251 dhcpd[31808]: Unable to add forward map from PRGEN11420.gep.gt.be to 10.15.129.164: REFUSED
So I need to somehow retrieve the severity_label from <131> or <134>. I'm using this filter to start with:
I have tried to reply to your question in the nagios forum, but I can't post reply there (I have created forum account yesterday, but still cannot post anything). So I'm posting it here - it is the right place anyway.
I'm not sure if you can convert the numbers from syslog rfc5424 to severity labels using the syslog_pri(_field_name) . Yesterday I was trying to do exactly the same thing as you, unsuccessfully so I read in the manual of this filter plugin: "Filter plugin for logstash to parse the PRI field from the front of a Syslog (RFC3164) message
And the severity numbers in RFC3164 are different from the numbers in RFC5424, so maybe this is why it doesn't work.
So I have achieved the desired severity labels by using translate plugin:
In the logstash directory, install this filter:
bin/plugin install logstash-filter-translate
then I have created a dictionary file (because it is way too big for inline in the config):
This way you can keep your severity number in "syslog5424_pri" field, but you will have a new field called 'syslog5424_sev' which will contain the desired 'notice','warning'.... severity labels.
I'm happy with the results now, but I really think this should be possible by some logstash intergrated filter in the future versions.
Thanks for taking the time to pass this info to me. I'm on holiday at the moment, but I'll definitely look into your solution from the moment I'm back at work.
I just tried your solution and it is working fine for me. the syslogpri5424_pri field is getting translated very nice. Thank you very much for sharing your solution!
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.