I’m new to Graylog and trying to setup a pipeline rule.
The Pipeline “Rules quick reference” shows that set_field can accept 6 parameters:
field
value
prefix
suffix
message
default
I would like to use the “default” parameter to handle cases where a geoip field is missing/null. I am assuming I need to supply all 6 set_field parameters in order to supply a default value of empty string.
For example, I would like to have a default value in case the geoip subdivisions array is empty:
set_field("dst_ip_geo_state", geo["subdivisions"].[0].iso_code, "", "", $message, "");
I’ve tried several permutations of set_field with 6 parameters, but I can’t figure out the syntax. I’m getting validation errors like “Expected type Message for argument message”.
I can’t find any examples of using set_field() with all 6 parameters. Can anyone provide an actual example of set_field showing how to supply the Message object as the 5th parameter?
Environment:
Graylog v4.3.5+32fa802