I have a log line:
test-process 2020/06/04 13:35:42 process.go:646: INFO: GetTest: X-Request-Id: 14242dqdq2aA, status: HTTP 200 OK
Below is my filter:
filter {
dissect {
mapping => {
"message" => "%{process} %{timestamp} %{+timestamp} %{function} %{log_level} %{msg}"
}
remove_tag => [ "_dissectfailure" ]
}
mutate {
gsub => [
"message", "\s*\|\s*", "|",
"log_level", ":$", "" ,
"function", ":$", ""
]
remove_field => [ "process" ]
}
date {
match => [ "timestamp" , "YYYY/MM/DD HH:mm:ss" ]
target => "timestamp"
}
kv {
field_split => "|"
}
}
The problem is with the timestamp in the output. It is "2020-01-04" instead of "2020-06-04" . How can I fix it ?
{
"message" => "test-process 2020/06/04 13:35:42 process.go:646: INFO: GetTest: X-Request-Id: 14242dqdq2aA, status: HTTP 200 OK",
"log_level" => "INFO",
"msg" => "GetTest: X-Request-Id: 14242dqdq2aA, status: HTTP 200 OK",
"@timestamp" => 2020-06-18T12:53:25.219Z,
"@version" => "1",
"function" => "process.go:646",
"host" => "test.example.com",
"timestamp" => 2020-01-04T12:35:42.000Z
}