Log file like this:
2019-11-05 10:08:25,452 : [INFO ] http-5 [abc:571] SENT => Status : [nt-sent] | cId/gId : [20799461/ABC] | OBID : [08824] | SID : [18393567] | StatusMsg : [null]
2019-11-05 10:08:25,453 : [INFO ] http-5 [xyz:-1] Executing SP ACT_nt with Action [UPDATE]
filter {
if [log][file][path] == "/home/jhon/jhon.log" {
grok {
match => { "message" => "%{TIMESTAMP_ISO8601:time},%{DATA:ID} : \[%{DATA:loglevel}\] %{DATA:thread} \[%{DATA:class}\] %{DATA:bal} %{DATA:bal2} %{GREEDYDATA:message}" }
overwrite => "message"
}
}
else if [class] == "abc:571" {
kv {
allow_duplicate_values => false
include_brackets => true
field_split => "|"
value_split => ":"
}
mutate {
remove_field => [ "message"]
}
}
else if [Status] == "nt-sent" {
grok {
match => { "cId/gId" => "%{DATA:cId}/%{DATA:gId}:" }
}
mutate {
remove_field => [ "cId/gId"]
}
}
}
"thread" => "http-5",
"class" => "abc:571",
"log.file.path" => "/home/jhon/jhon.log"
"ID" => "796",
"loglevel" => "INFO ",
"time" => "2019-11-05 10:27:30",
"@timestamp" => 2019-11-05T04:27:32.677Z,
"message" => "Status : [nt-sent] | cId/gId : [20799461/ABC] | OBID : [08824] | SID : [18393567] | StatusMsg : [null]"
kv filtering not works.
Thanks for helping.