Hi All,
Very new to the ELK stack and have set up a server to ingest all my syslogs and firewall logs.
Up until last night at exactly 6:59 PM all my syslogs were being ingested and the date field was being parsed out, even though I was getting a _dateparserror tag on my syslog Elasticsearch entries. For some reason, last night at 6:59:59, all hosts that aren't sending an ISO8601 type of date format are now getting parse errors and the documents all appear to be being discarded.
This is what I'm seeing in the logstash-plain.log:
[2020-09-18T16:05:34,833][WARN ][logstash.outputs.elasticsearch][main][14956b1512991c457313d511f58c1e48be189a385472ceb87b1701e089de8765] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"syslog-2020.09.18", :routing=>nil, :_type=>"system_logs"}, #LogStash::Event:0x588151a0], :response=>{"index"=>{"_index"=>"syslog-2020.09.18", "_type"=>"system_logs", "_id"=>"eE_SonQBwN2n-kChcffw", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [syslog_timestamp] of type [date] in document with id 'eE_SonQBwN2n-kChcffw'. Preview of field's value: 'Sep 18 16:05:12'", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"failed to parse date field [Sep 18 16:05:12] with format [strict_date_optional_time||epoch_millis]", "caused_by"=>{"type"=>"date_time_parse_exception", "reason"=>"Failed to parse with all enclosed parsers"}}}}}}
The relevant filtering in my /etc/logstash/conf.d is below:
filter {
if "syslog" in [tags] {
grok {
match => { "message" => "%{SYSLOG5424PRI}%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ]
}
date {
match => [ "syslog_timestamp", "MMM d HH:mm:ss", "MMM dd HH:mm:ss", "ISO8601" ]
target => "syslog_timestamp"
}
(Note: I added the line target => "syslog_timestamp"
today as a result of what I found on a Google search, but it hasn't fixed the issue.)
Based on what I can see in the log above, the filtering should match the date Sep 18 16:05:12. I'm at a loss as to why, all of a sudden last night, it would have stopped ingesting the logs.
Has anyone seen this before? Any idea what I might be doing wrong here?
Thanks in advance.