Document transform_result and both forms of absent, the transforms
that can signal an error, how must_error and error_or treat bodies and
files inspected in parts, and the rule-load constraints. Note the
behavior changes in upgrade.rst: absent's mode string in the analyzer,
absent: or_else rejected after a transform that can fail, gunzip and
zlib_deflate keeping their input on failure, pcrexform's empty capture,
and from_base64's bytes handling.
Issue: 7313
Issue: 7114
The keyword ``absent`` checks that a sticky buffer does not exist.
It can be used without any argument to match only on absent buffer :
The keyword ``absent`` checks that a sticky buffer does not exist. It takes
either no argument (match only on absent buffer) or ``or_else`` (match on
absent buffer or fall through to subsequent keywords).
To match on the result of a transform (``must_succeed``, ``must_error``,
``error_or``), see :ref:`rules-keyword-transform-result`.
absent (no argument)
~~~~~~~~~~~~~~~~~~~~
Example of ``absent`` in a rule:
Match only when the buffer is absent (NULL). No other keyword is allowed
on the same buffer.
..container:: example-rule
alert http any any -> any any (msg:"HTTP request without referer"; :example-rule-emphasis:`http.referer; absent;` sid:1; rev:1;)
absent: or_else
~~~~~~~~~~~~~~~
It can take an argument "or_else" to match on absent buffer or on what comes next such as negated content, for instance :
Match when the buffer is absent (NULL) OR when subsequent keywords match,
for example a negated content.
..container:: example-rule
alert http any any -> any any (msg:"HTTP request without referer"; :example-rule-emphasis:`http.referer; absent: or_else;` content: !"abc"; sid:1; rev:1;)
alert http any any -> any any (msg:"HTTP request without referer"; \