AUSEARCH\_ADD\_REGEX(3) Linux Audit API AUSEARCH\_ADD\_REGEX(3)

# [NAME](#NAME)

ausearch\_add\_regex - use regular expression search rule

# [SYNOPSIS](#SYNOPSIS)

**#include &lt;auparse.h&gt;**

**int ausearch\_add\_regex(auparse\_state\_t \*au,constchar\*"regexp);"**

# [DESCRIPTION](#DESCRIPTION)

ausearch\_add\_regex adds one search condition based on a regular expression to the current audit search expression. The search conditions can then be used to scan logs, files, or buffers for something of interest. The regular expression follows the posix extended regular expression conventions, and is matched against the full record (without interpreting field values).

If an existing search expression *E* is already defined, this function replaces it by **(E && this\_regexp)**.

# [RETURN VALUE](#RETURN_VALUE)

Returns -1 if an error occurs; otherwise, 0 for success.

# [SEE ALSO](#SEE_ALSO)

[**ausearch\_add\_expression**(3)](/man/os/audit/ausearch_add_expression.3), [**ausearch\_add\_item**(3)](/man/os/audit/ausearch_add_item.3), [**ausearch\_clear**(3)](/man/os/audit/ausearch_clear.3), [**ausearch\_next\_event**(3)](/man/os/audit/ausearch_next_event.3), [**ausearch\_cur\_event**(3)](/man/os/audit/ausearch_cur_event.3), [**regcomp**(3)](/man/os/audit/regcomp.3).

# [AUTHOR](#AUTHOR)

Steve Grubb

Sept 2007 Red Hat

---

Document: ausearch_add_regex(3) from audit 4.2.1-r2 (Chainguard OS)
Source: https://github.com/linux-audit/audit-userspace
