Hello All,
I have log lines coming from K8's to logstash and they have two timestamps back to back. How can I parse those fields in let's say @timestamp field and timestamp2 field?
My log lines look like:
2021-10-08 18:39:09.866 EDT 2021-10-08 18:39:09.866 [http-nio-8443] [] Filter - CorrelationFilter Start
my logstash filter looks like:
filter {
multiline {
pattern => "^\[0-9]{4}-[0-9]{2}"
what => "previous"
negate=> true
}
grok {###Not sure how to write the grok for the second timestamp
match => ["message", "%{DATESTAMP:timestamp}"]
}
date {
match => ["timestamp", "yyyy-MM-dd H:m:s.SSS"]
target => ["@timestamp"]
remove_field => ["timestamp"]
}
mutate {
add_field => { "type" => "K8logs" }
}
}
I am having difficulties in writing the grok for the second timestamp filter.
Any help is appreciated.
Thank you.