I have a log line.
1590644837.665697 2020-05-28 07:47:17,665 to:004915122898981|id:Hello there|status_code:SentSMSOK|status_message:abc.exmaple.com - 200|message:(2020-05-28 07:46:41) TEST: stuck-daily@example.com is OK (OK - Table:ETL_PROCESS_DAILY_LOADS HoursOld:6 CountResult:0 (10min cache))!
This is my logstash config:
input {
stdin { }
}
filter {
grok {
match => [
"message" , "%{GREEDYDATA:data}"
]
}
date {
match => [ "timestamp" , "dd/MMM/YYYY:HH:mm:ss Z" ]
remove_field => [ "timestamp" ]
}
if [data] {
kv {
source => "data"
field_split => "|"
value_split => ":"
}
}
}
output {
stdout { codec => rubydebug }
}
Here is the output from logstash:
{
"data" => "1590644837.665697 2020-05-28 07:47:17,665 to:004915122898981|id:Hello there|status_code:SentSMSOK|status_message:abc.exmaple.com - 200|message:(2020-05-28 07:46:41) TEST: stuck-daily@example.com is OK (OK - Table:ETL_PROCESS_DAILY_LOADS HoursOld:6 CountResult:0 (10min cache))!",
"message" => "(2020-05-28 07:46:41) TEST: stuck-daily@example.com is OK (OK - Table:ETL_PROCESS_DAILY_LOADS HoursOld:6 CountResult:0 (10min cache))!",
"status_message" => "abc.exmaple.com - 200",
"@timestamp" => 2020-05-28T06:57:54.609Z,
"@version" => "1",
"host" => "def",
"1590644837.665697 2020-05-28 07" => "47:17,665 to:004915122898981",
"id" => "Hello there",
"status_code" => "SentSMSOK"
}
The message filed is being overwritten by the message field from the log file. How we can rename the message field from the log?