I have used http://grokdebug.herokuapp.com/ to create the grok match statements based on tcpdump of the syslog strips the ELK box is receiving. However, when checking Kibana, the logs are not parsed. i have used service logstash configtest and got confirmation the syntax is correct.
(IPs and other info are fake, but strings are intact).
TCPDUMP 1:
15:51:23.173798 IP firewall.local.46932 > elk.local.syslog: SYSLOG local7.notice, length: 316
E..XC'@.@.r=.........T...Dx-<189>Jan 17 15:51:23 2016 firewall src="10.10.1.202:61227" dst="8.8.8.8:53" msg="priority:16, from LAN1 to WAN, UDP, service DNS_UDP, ACCEPT" note="ACCESS FORWARD" user="unknown" devID="yyyyyyy" cat="Firewall" class="Access Control" ob="0" ob_mac="000000000000" dir="LAN1:WAN" protoID=17 proto="DNS_UDP"
SYSLOG STRIP 1: <189>Jan 17 15:51:23 2016 firewall src="10.10.1.202:61227" dst="8.8.8.8:53" msg="priority:16, from LAN1 to WAN, UDP, service DNS_UDP, ACCEPT" note="ACCESS FORWARD" user="unknown" devID="yyyyyyy" cat="Firewall" class="Access Control" ob="0" ob_mac="000000000000" dir="LAN1:WAN" protoID=17 proto="DNS_UDP"<%{NUMBER:syslog_index}>%{SYSLOGTIMESTAMP:syslog_timestamp} %{YEAR:YEAR} %{WORD:device} src="%{IP:source_ip}:%{BASE10NUM:source_port}" dst="%{IP:destination_ip}:%{BASE10NUM:destination_port}" msg="%{DATA:log_type}" note="%{DATA:log_note}" user="%{DATA:user}" devID="%{DATA:device_id}" cat="%{DATA:log_category}" class=%{DATA:class} ob=%{DATA:ob} ob_mac=%{DATA:ob_mac} dir="%{DATA:traffic_direction}" protoID=%{DATA:protocol_number} proto="%{DATA:protocol_service}"
GROK STATEMENT 1: <%{NUMBER:syslog_index}>%{SYSLOGTIMESTAMP:syslog_timestamp} %{YEAR:YEAR} %{WORD:device} src="%{IP:source_ip}:%{BASE10NUM:source_port}" dst="%{IP:destination_ip}:%{BASE10NUM:destination_port}" msg="%{DATA:log_type}" note="%{DATA:log_note}" user="%{DATA:user}" devID="%{DATA:device_id}" cat="%{DATA:log_category}" class=%{DATA:class} ob=%{DATA:ob} ob_mac=%{DATA:ob_mac} dir="%{DATA:traffic_direction}" protoID=%{DATA:protocol_number} proto="%{DATA:protocol_service}"
TCPDUMP 2:
15:51:23.295700 IP firewall.local.46932 > elk.local.syslog: SYSLOG local7.info, length: 249
E...C)@.@.r~.........T....2.<190>Jan 17 15:51:23 2016 firewall src="10.10.1.212:38942" dst="8.8.8.8:40020" msg="Traffic Log" note="Traffic Log" user="unknown" devID="yyyyyyy" cat="Traffic Log" duration=300 sent=157 rcvd=49 dir="lan1:wan1" protoID=17 proto="others"
SYSLOG STRIP 2: <190>Jan 17 15:36:05 2016 firewall src="10.10.1.212:38942" dst="8.8.8.8:40007" msg="Traffic Log" note="Traffic Log" user="unknown" devID="yyyyyyy" cat="Traffic Log" duration=300 sent=158 rcvd=49 dir="lan1:wan1" protoID=17 proto="others"
GROK STATEMENT 2: <%{NUMBER:syslog_index}>%{SYSLOGTIMESTAMP:syslog_timestamp} %{YEAR:YEAR} %{WORD:device} src="%{IP:source_ip}:%{BASE10NUM:source_port}" dst="%{IP:destination_ip}:%{BASE10NUM:destination_port}" msg="%{DATA:log_type}" note="%{DATA:log_note}" user="%{DATA:user}" devID="%{DATA:device_id}" cat="%{DATA:log_category}" duration=%{DATA:duration} sent=%{DATA:sent} rcvd=%{DATA:received} dir="%{DATA:traffic_direction}" protoID=%{DATA:protocol_number} proto="%{DATA:protocol_service}"
logstash.conf
input {
syslog {
port => 5514
type => "syslog"
}
}
filter {
if [type] == "syslog" {
grok {
match => ["message" , "<%{NUMBER:syslog_index}>%{SYSLOGTIMESTAMP:syslog_timestamp} %{YEAR:YEAR} %{WORD:device} src="%{IP:source_ip}:%{BASE10NUM:source_port}" dst="%{IP:destination_ip}:%{BASE10NUM:destination_port}" msg="%{DATA:log_type}" note="%{DATA:log_note}" user="%{DATA:user}" devID="%{DATA:device_id}" cat="%{DATA:log_category}" class=%{DATA:class} ob=%{DATA:ob} ob_mac=%{DATA:ob_mac} dir="%{DATA:traffic_direction}" protoID=%{DATA:protocol_number} proto="%{DATA:protocol_service}""]
}
grok {
match => ["message" , "<%{NUMBER:syslog_index}>%{SYSLOGTIMESTAMP:syslog_timestamp} %{YEAR:YEAR} %{WORD:device} src="%{IP:source_ip}:%{BASE10NUM:source_port}" dst="%{IP:destination_ip}:%{BASE10NUM:destination_port}" msg="%{DATA:log_type}" note="%{DATA:log_note}" user="%{DATA:user}" devID="%{DATA:device_id}" cat="%{DATA:log_category}" duration=%{DATA:duration} sent=%{DATA:sent} rcvd=%{DATA:received} dir="%{DATA:traffic_direction}" protoID=%{DATA:protocol_number} proto="%{DATA:protocol_service}""]
}
}
output {
elasticsearch { hosts => ["localhost:9200"] }
stdout { codec => rubydebug }
}