hi,
i want to remove an element from tags array in logstash .
logstash conf:
filter {
kv{
source => "message"
field_split => ","
}
date {
match => [ "joiningdate", "MMMM dd yyyy HH:mm:ss.SSS", "yyyy-mm-dd", "yyyy.mm.dd" ]
}
if "_dateparsefailure" in [tags] {
mutate {
add_field => { "JoiningDate" => "%{joiningdate}"}
remove_field => ["joiningdate"]
}
}
}
message : joiningdate=1234, name=asdf
output:
{
"host" => "xyz",
"JoiningDate" => "1234",
" name" => "asdf\r",
"message" => "joiningdate=1234, name=asdf\r",
"@version" => "1",
"@timestamp" => 2018-03-01T08:32:54.572Z,
"tags" => [
[0] "_dateparsefailure",
[1] "beats_input_code_plain_applied"
]
}
dateparsefailure can be in any index of tags array that should be removed.
tried tag_on_failure in date filter but in my logstash conf i am adding new field based on date parse failure. so pls suggest to remove _dateparsefailure from tags array dynamically