Hi there,
I've got three questions around Logstash:
- We're using an older version of Logstash (6.5.4) and experiencing currently an issue while parsing a date. I've got absolutely no idea anymore what I can do to make it work.
This is the exception:
[2022-04-25T09:32:54,248][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"webtools-dev-2022.04.25", :_type=>"doc", :routing=>nil}, #<LogStash::Event:0x12bd057c>], :response=>{"index"=>{"_index"=>"webtools-dev-2022.04.25", "_type"=>"doc", "_id"=>"5usRYIABZkNlZjpwFuFa", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [log_timestamp] of type [date]", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"Invalid format: \"2022-04-25 09:32:41.847\" is malformed at \" 09:32:41.847\""}}}}}
[2022-04-25T09:32:54,248][WARN ][logstash.outputs.elasticsearch] Could not index event to Elasticsearch. {:status=>400, :action=>["index", {:_id=>nil, :_index=>"webtools-dev-2022.04.25", :_type=>"doc", :routing=>nil}, #<LogStash::Event:0x50fd26ba>], :response=>{"index"=>{"_index"=>"webtools-dev-2022.04.25", "_type"=>"doc", "_id"=>"5-sRYIABZkNlZjpwFuFa", "status"=>400, "error"=>{"type"=>"mapper_parsing_exception", "reason"=>"failed to parse field [log_timestamp] of type [date]", "caused_by"=>{"type"=>"illegal_argument_exception", "reason"=>"Invalid format: \"09:32:46.822\" is malformed at \":32:46.822\""}}}}}
This is our date parsing part:
date {
match => [ "log_timestamp", "ISO8601", "MMM dd, yyyy HH:mm:ss a", "yyyy-MM-dd HH:mm:ss.SSS", "yyyy-MM-dd HH:mm:ss,SSS", "HH:mm:ss.SSS", "dd-MMM-yyyy HH:mm:ss.SSS"]
timezone => "Europe/Berlin"
target => "@timestamp"
}
If I use log_timestamp - the originating field - as target it funnily works, but if I use @timestamp
it throws the exception above. I'm pretty much sure our parse expressions are correct. We need different expressions because unfortunately the input expressions are not very streamlined yet.
-
Furthermore I'm also wondering how I can add the current day to a timestamp that only exists of the time.
-
I found a
@time
field in the index and don't know where it originates from. Is that a field Filebeat adds by default somehow? It's exactly the log line timestamp and maybe I can just use that field instead parsing the expression then.
Thanks Bastian