Hi All,
End Goal:
- Our team is creating a query which triggers on dev vs prod rules and we need to query the friendly rule name within the saved detection rule.
Is it possible to query detection data (detection.detection.) inside a UDM rule or is there any other way within UDM to get this information?
rule dev_rule_name {
meta:
author = "SOMEONE"
events:
$detections.metadata.log_type = "GCP_CLOUDAUDIT"
(
detection.detection.rule_name != /prod_/ and
$detections.metadata.product_event_type = SOME EVENT
)
outcome:
//OUTCOME FIELDS
condition:
$detections
}
When I try to do something similar to the above, I get parsing errors:

I’ve Tried:
- Using variables, e.g. $rule_name = detection.detection.rule_name
- Using Regex, e.g. re.regex(detection.detection.rule_name, `^prod_`) and
- Calling it using by prepending $detections, e.g. re.regex($detections.detection.detection.rule_name, `^prod_`)
The Raw log and the Event fields do not contain the friendly name, but the outcome / columns does contain this data:

Any advice would be appreciated.
TIA!







