AUSEARCH_ADD_REGEX(3)

πŸ“¦
version 4.2.1 Β· 3 versions
, in alpine 3.23, alpine 3.24, arch rolling, centos-stream 10, fedora 43, fedora 44, nixpkgs unstable, ubuntu resolute, ubuntu stonking

✨ 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 success
  • 0 β€” returned for success ✨ we love to see it

🌈 SEE ALSO 🌈

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 🫢