hi,
I have JSON which has key body.message and content of this key can be JSON[OBJECT] or text (I cant insert like this to ES as it giving mapping error)
I want to move it to another field if it look like text and exists
But this config is not working (Now it matching everything)
Please help me,
Thanks in advance.
# if not look like json and exists move to other field and remove source
if [body][message] !~ /{.*}/ and [body][message] {
mutate {
add_field => { "message_text" => "%{[body][message]}" }
remove_field => [ "[body][message]" ]
}
}