AUSEARCH_ADD_REGEX(3)
β¨ AUSEARCH_ADD_REGEX β¨
okay bestie, welcome to ausearch_add_regex β it's a Linux Audit API moment, manual section 3, and it's literally the girl who matches regex against your audit records. let's get into it π
πΈ NAME πΈ
ausearch_add_regex β use regular expression search rule π
π¦ SYNOPSIS π¦
#include <auparse.h>
int ausearch_add_regex(auparse_state_t *au,constchar*"regexp);"
no bc why is that signature like that π it's giving unhinged but we're keeping it exactly as it is, no cap. copy it verbatim or perish.
π DESCRIPTION π
so what does this icon actually <em>do</em>? ausearch_add_regex adds one search condition based on a regular expression to the current audit search expression. one. single. condition. main character energy, but only one. β¨
then those search conditions can be used to scan logs, files, or buffers for something of interest. slay.
the regular expression follows the posix extended regular expression conventions, and β listen closely bestie β it is matched against the full record, without interpreting field values. so it's the whole thing, raw, no field-by-field breakdown. periodt. π«Ά
and here's the plot twist: if an existing search expression E is already defined, this function replaces it by (E && this_regexp). so it's not throwing your old expression away, it's gluing them together with an AND. obsessed. π₯
π RETURN VALUE π
-1β returned if an error occurs π it's not giving success0β returned for success β¨ we love to see it
π SEE ALSO π
ausearch_add_expression(3)ausearch_add_item(3)ausearch_clear(3)ausearch_next_event(3)ausearch_cur_event(3)regcomp(3)
go read those too, iykyk ππ
π AUTHOR π
Steve Grubb π«
ok that's the whole page bestie, you ate that. this was Red Hat, dated Sept 2007 β yes she's an elder but she still serves π π¦ bye pookie π«Ά
π¦ where this page comes from
- alpine 3.23: audit-doc 4.1.2-r2 Β· LGPL-2.1-or-later
- alpine 3.24: audit-doc 4.1.2-r6 Β· LGPL-2.1-or-later
- arch rolling: audit 4.2.1-1 Β· GPL-2.0-or-later AND LGPL-2.0-or-later
- centos-stream 10: audit-libs-devel 4.2.1-3.el10 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.1.1-2.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.1.1-2.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.2.1-1.fc43 Β· LGPL-2.0-or-later
- fedora 43: audit-libs-devel 4.2.1-1.fc43 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.1.4-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.1.4-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.2.1-1.fc44 Β· LGPL-2.0-or-later
- fedora 44: audit-libs-devel 4.2.1-1.fc44 Β· LGPL-2.0-or-later
- nixpkgs unstable: audit 4.2.1
- ubuntu resolute: libauparse-dev 1:4.1.2-1build1 Β· GPL-2.0-only
- ubuntu resolute: libauparse-dev 1:4.1.2-1ubuntu0.1 Β· GPL-2.0-only
- ubuntu stonking: libauparse-dev 1:4.1.2-1ubuntu1 Β· GPL-2.0-only
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms