Hello,
I am new to logstash and I have a question about creating nested field with the add_field filter
I use logstash 7.17.
I want to create a nested field from a string, but it doesn't work. The other way around (create a string from a nested array), it does work. Here is a snippet of my code :
mutate {
replace => {
"user" => "%{[individual][user]}"
}
}
mutate {
add_field => {
"[user][userType]" => "SUBSCRIBER"
}
}
[...]
if (![user]) {
drop {
id => "No_user"
}
} else if (![user][userType]) {
drop {
id => "No_userType"
}
}
But this code drop with the id No_userType
I did this code following the documentation about creating a field from a nested_field, and I also tried to create it inside the ruby plugin with event.set from the forum here but I have the same drop
Any help would be appreciated, thank you in advance