I am using logstash to parse my logs. when i am parsing the json (which contains a "message" field) overrides the default message field. I tried using remove_field option of json{ } filter but that didn't work work for me.
Here is my filter code:
filter {
mutate { gsub => ["message",""","'"] }
mutate { gsub => ["message",".","_"] }
csv {
columns => ["TIMESTAMP","HEADERS","FIELD1","FIELD2","FIELD2_TIME","INTER_FIELD2"]
separator => "|"
}
mutate { gsub => ["FIELD1", "'", '"']}
json { source => "FIELD1" remove_field => [ "message" ] }
mutate { gsub => ["FIELD2", "'", '"']}
json { source => "FIELD2" remove_field => [ "message" ] }
}
How to avoid overriding of the message field ?