Hi all,
Just to share with you a strange grokparsefailure behavior and I try to understand why...
Logstash Input:
input { file { path => "/etc/logstash/test-2016-04-17-05.log" start_position => beginning ignore_older => 0 } }
Logstash Filter:
filter { grok { match => { "message" => [ "%{DHCP_ACK}", "%{DHCP_OFFER}" ] } add_tag => [ "infoblox" ] match => { "path" => "%{YEAR:log_year}" } } mutate { add_field => { "@source_host" => "%{Infoblox_server}" } } dns { nameserver => "192.168.1.1" reverse => [ "@source_host" ] action => "replace" } }
Logstash Output:
output { file { path => "/etc/logstash/test_infoblox_output.txt" } stdout { } }
When my input file contains just one line ("2016-04-17T05:35:55+02:00 192.168.1.20 info Added new forward map from dhcp-192.168.2.3.test.corp to 192.168.2.4"), I get the next output:
_{"message":"2016-04-17T05:35:55+02:00 192.168.1.20 info Added new forward map from dhcp-192.168.2.3.test.corp to 192.168.2.4","@version":"1","@timestamp":"2016-04-26T08:38:39.254Z","path":"/etc/logstash/test-2016-04-17-05.log","host":"log1","tags":["grokparsefailure"],"@source_host":"%{Infoblox_server}"}
So for me, it is the right result regarding my patterns (patterns tested with grokdebugger).
But when my input file contains 3 Million lines, I get the next output:
{"message":"2016-04-17T05:35:55+02:00 192.168.1.20 info Added new forward map from dhcp-192.168.2.3.test.corp to 192.168.1.20","@version":"1","@timestamp":"2016-04-25T15:23:39.780Z","path":"/etc/logstash/test-2016-04-17-05.log","host":"log1","log_year":"2016","tags":["infoblox"],"@source_host":"%{Infoblox_server}"}
I don't understand why I don't get "_grojparsefailure" as expected ?
If you have any idea !
Thanks in advance,
Alexandre