AUSEARCH-EXPRESSION(5) | Linux Audit | AUSEARCH-EXPRESSION(5) |
ausearch-expression - audit search expression format
This man page describes the format of "ausearch expressions". Parsing and evaluation of these expressions is provided by libauparse and is common to applications that use this library.
White space (ASCII space, tab and new-line characters) between tokens is ignored. The following tokens are recognized:
Anywhere an unquoted string is valid, a quoted string is valid as well, and vice versa. In particular, field names may be specified using quoted strings, and field values may be specified using unquoted strings.
The primary expression has one of the following forms:
\regexp string-or-regexp
field is either a string, which specifies the first field with that name within the current audit record, or the \ escape character followed by a string, which specifies a virtual field with the specified name (virtual fields are defined in a later section).
field is a string. operator specifies the comparison to perform
In the special case of \regexp regexp-or-string, the current audit record is taken as a string (without interpreting field values), and matched against regexp-or-string. regexp-or-string is an extended regular expression, using a string or regexp token (in other words, delimited by " or /).
If E1 and E2 are valid expressions, then ! E1, E1 && E2, and E1 || E2 are valid expressions as well, with the usual C semantics and evaluation priorities. Note that ! field op value is interpreted as !(field op value), not as (!field) op value.
The following virtual fields are defined:
ts:seconds.milli
where seconds and milli are decimal numbers specifying the seconds and milliseconds part of the timestamp, respectively.
ts:seconds.milli:serial
where serial is a decimal number specifying the event's serial number.
The expression as a whole applies to a single record. The expression is true for a specified event if it is true for any record associated with the event.
As a demonstration of the semantics of handling missing fields, the following expression is true if field is present:
and the same expression surrounded by !( and ) is true if field is not present.
New escape sequences for quoted strings may be defined.
For currently defined virtual fields that do not define a "raw" or "interpreted" string, the definition may be added. Therefore, don't rely on the fact that comparing the "raw" or "interpreted" string of the field with any value is false.
New formats of value constants for the \timestamp virtual field may be added.
Miloslav Trmac
Feb 2008 | Red Hat |