Hello,
Im trying to parse only LOGLEVEL field using grok but it doesn't work.
My logstash.log comes from :
[2020-02-20T15:55:46,198][ERROR][logstash.inputs.jdbc ] Java::ComSybaseJdbc3Jdbc::SybSQLException: Difference of two datetime fields caused overflow at runtime.:
[2020-02-20T16:27:36,610][INFO ][logstash.pipeline ] Pipeline has terminated {:pipeline_id=>"main", :thread=>"#<Thread:0x1b10a501 run>"}
and the grock filter
input {
file {
path => "/logs/logstash-plain-duplicate.log"
}
}
#############
#############
filter {
grok {
match => { "message" => "%{TIMESTAMP_ISO8601:timestamp} %{LOGLEVEL:level} \s+[%{JAVACLASS:class}] %{GREEDYDATA:message} " }
}
mutate{
add_field =>{
"lvl" => "%{LOGLEVEL}"
}
}
}
#############
#############
output {
stdout { codec => rubydebug }
}
And here is the result :
{
"@version" => "1",
"path" => "/logs/logstash-plain-duplicate.log",
"host" => "SERV100",
"@timestamp" => 2020-02-21T13:38:31.138Z,
"tags" => [
[0] "_grokparsefailure"
],
"lvl" => "%{LOGLEVEL}",
"message" => "[2020-02-20T15:55:46,198][ERROR][logstash.inputs.jdbc ] Java::ComSybaseJdbc3Jdbc::SybSQLException: Difference of two datetime fields caused overflow at runtime.:"
}
Thank you