I have the following code in my logstash configuration where gsub is not applied
if[exception][stacktrace] {
mutate {
gsub => ["exception.stacktrace","\s*at\s(?!package).*", ""]
}
}
The exception.stacktrace field is set in a grok match above.
Using the same message, if I remove the conditional, then the gsub is applied as expected, thus the conditional is not working!
I need to use the conditional because my grok matcher has two patterns, one with stacktrace other without it.
Is this a bug, or it's not the correct way to check a nested field existance?
Logstash 7.3.0