Skip to content

Commit 5b76b36

Browse files
authored
doc: add example to modify expert for if on empty fields (#2674)
1 parent 0342b77 commit 5b76b36

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/user/bots.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3329,7 +3329,7 @@ One configuration file can contain an arbitrary number of rules.
33293329

33303330
#### Condition
33313331

3332-
* **Empty string**: If the value for a condition is an empty string, the bot checks if the field does not exist. This is useful to apply default values for empty fields.
3332+
* **Empty string**: If the value for a condition is an empty string, the bot checks if the field does not exist. This is useful to apply default values for empty fields. For example, use `"if": {"severity": ""}` to check for events without the `severity` field.
33333333
* A non-empty **string**: The matching uses [regular expressions](https://docs.python.org/3/library/re.html#re.search) to match the field. Use explicit beginning and end markers to match the full string instead of a substring: `^regex$`.
33343334
If the field is not a string, it will be converted to a string first. This allows for matching numeric values with regular expressions.
33353335
To escape a character in the regular expression, JSON requires you to double-escape, for example, in `"extra.version": "^10\\.0"` the `.` is matched as literal character.

0 commit comments

Comments
 (0)