I'm building a custom parser and below is a snippet for which I'm facing a issue. This particular field is not always present in all events. It's gives values as False or will not be available altogether.
JSON:
"body
{
custom
{
security
{
blocked = "FALSE"
}}"
Below expression is not only extracting the value but gives the error message when validating the parser - generic::unknown: pipeline.ParseLogEntry failed: LOG_PARSING_CBN_ERROR: "generic::invalid_argument: pipeline failed: filter conditional (9) failed: failed to evaluate expression: generic::invalid_argument: \\"body.custom.security.blocked\\" not found in state data"
"if [body][custom][security][blocked] =~ "FALSE" {
mutate {
merge => {
"event.idm.read_only_udm.security_result" => "ALLOW"
}
}
}"
Adding on error statement also doesn't make the trick.