udm validation failed: principal field is not set
The event_type you chose requires principal (or target) fields you did not fill. Populate them, or pick an event type that matches the data you have.
The error
generic::invalid_argument: udm validation failed: principal field is not set: invalid argumentWhy it happens
Each metadata.event_type has required fields. NETWORK_CONNECTION, for example, needs a principal machine and a target machine; STATUS_UPDATE needs a principal machine; USER_LOGIN needs a target user.
The same family of errors: "target field is not set" and "invalid target device: device is empty" (NETWORK_HTTP without a target hostname or IP).
It often appears only for some log lines, because a grok failed on those lines and left the IP or hostname empty.
How to fix it
- Decide the event type after mapping, based on what you actually filled. Fall back to GENERIC_EVENT when the required nouns are empty.
- "Machine" means hostname, IP, MAC or asset ID: any one of them is enough.
Works:
if [src_ip] != "" and [dst_ip] != "" {
mutate { replace => { "event.idm.read_only_udm.metadata.event_type" => "NETWORK_CONNECTION" } }
} else if [src_ip] != "" or [host] != "" {
mutate { replace => { "event.idm.read_only_udm.metadata.event_type" => "STATUS_UPDATE" } }
} else {
mutate { replace => { "event.idm.read_only_udm.metadata.event_type" => "GENERIC_EVENT" } }
}Where people usually hit it
principal.hostname, principal.ip, target.ip, target.hostname, target.user.userid
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.