I am trying to setup a custom logstash filter to parse Juniper SRX logs. Without making any changes I see messages being parsed as follows:
{
"_index": "xxxxx:logstash-syslog-2018.04.16",
"_type": "doc",
"_id": "TIbXzmIBbGlsOh53NQat",
"_version": 1,
"_score": null,
"_source": {
"port": 37766,
"@version": "1",
"syslog-host_from": "X.X.X.X",
"syslog-sourceip": "X.X.X.X",
"event_type": "RT_FLOW",
"syslog-facility": "user",
"syslog-host": "X.X.X.X",
"tags": [
"syslogng",
"syslog"
],
"syslog-legacy_msghdr": "RT_FLOW: ",
"@timestamp": "2018-04-16T14:23:53.153Z",
"logstash_time": 0.0016071796417236328,
"host": "gateway",
"syslog-tags": ".source.s_network",
"message": "RT_FLOW_SESSION_CLOSE: session closed idle Timeout: X.X.X.X/53946->X.X.X.X/443 None X.X.X.X/4042->X.X.X.X/443 source-nat-rule None 17 inside-to-untrust inside untrust 154354 8(2658) 8(2020) 74 UNKNOWN UNKNOWN N/A(N/A) vlan.2 UNKNOW",
"syslog-priority": "info"
},
"fields": {
"@timestamp": [
"2018-04-16T14:23:53.153Z"
]
},
"highlight": {
"event_type": [
"@kibana-highlighted-field@RT_FLOW@/kibana-highlighted-field@"
]
},
"sort": [
1523888633153
]
}
I started with creating a filter to initially just to add "firewall" tag and add "juniper_srx" in "type" field. I placed the file "1005_preprocess_junipersrx.conf" in /etc/logstash/custom, restarted the logstash and I do not see the tag applied nor the type field changed in the logs. I see the file was copied over to the /etc/logstash/conf.d/
Contents of the 1005_preprocess_junipersrx.conf file:
filter {
if "syslog" in [tags] {
if [event_type] == "RT_FLOW" {
mutate {
add_field => { "type" => "juniper_srx" }
add_tag => [ "firewall" ]
}
}
}
}
Thank you in advance for your help
Konrad
Konrad
--
Follow Security Onion on Twitter!
https://twitter.com/securityonion
---
You received this message because you are subscribed to the Google Groups "security-onion" group.
To unsubscribe from this group and stop receiving emails from it, send an email to security-onion+unsubscribe@googlegroups.com.
To post to this group, send email to security-onion@googlegroups.com.
Visit this group at https://groups.google.com/group/security-onion.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to security-onion+unsubscribe@googlegroups.com.
To post to this group, send email to security-onion@googlegroups.com.
Visit this group at https://groups.google.com/group/security-onion.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to security-onion+unsubscribe@googlegroups.com.
To post to this group, send email to security-onion@googlegroups.com.
Visit this group at https://groups.google.com/group/security-onion.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to security-onion+unsubscribe@googlegroups.com.
To post to this group, send email to security-onion@googlegroups.com.
Visit this group at https://groups.google.com/group/security-onion.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to security-onion+unsubscribe@googlegroups.com.
To post to this group, send email to security-onion@googlegroups.com.
Visit this group at https://groups.google.com/group/security-onion.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to security-onion+unsubscribe@googlegroups.com.
To post to this group, send email to security-onion@googlegroups.com.
Visit this group at https://groups.google.com/group/security-onion.
For more options, visit https://groups.google.com/d/optout.