received non-string raw output for enum field
Enum fields (event_type, severity, action, ip_protocol…) need one plain string that exactly matches an allowed value. Map vendor values with if/else.
The error
failed to convert raw output to events: ... field \"severity\": index 0: received non-string raw output for enum fieldWhy it happens
Enum fields only accept one of their allowed names as a plain string: metadata.event_type, security_result.severity, security_result.action, network.ip_protocol, network.direction and others.
You get this error when the value reaching the field is not a string: a converted number, a list, or an object, for example a field renamed in after a convert.
A string that is not one of the allowed names fails too, with a slightly different message.
How to fix it
- Never copy the vendor's severity or action straight into the enum. Map it with if/else to an allowed name, and keep the raw value in a free-text field such as severity_details.
- Remember that severity and action live inside security_result, which is repeated: set them on a temp object and merge it.
Works:
if [sev] == "crit" or [sev] == "alert" {
mutate { replace => { "sr.severity" => "CRITICAL" } }
} else if [sev] == "err" {
mutate { replace => { "sr.severity" => "ERROR" } }
} else if [sev] == "warning" {
mutate { replace => { "sr.severity" => "LOW" } }
} else {
mutate { replace => { "sr.severity" => "INFORMATIONAL" } }
}
mutate { replace => { "sr.severity_details" => "%{sev}" } }
mutate { merge => { "event.idm.read_only_udm.security_result" => "sr" } }Where people usually hit it
security_result.severity, security_result.action, metadata.event_type, network.ip_protocol, network.direction
Still failing?
One error usually hides the next. Parsleaf writes the full parser from your sample logs and keeps fixing it from the errors your SecOps tenant returns, until it passes. Generate your parser: the first one is free.