AUSEARCH_ADD_EXPRESSION(3)
π ausearch_add_expression(3) π
okay bestie, welcome to the Linux Audit API corner of the internet, this one is literally called ausearch_add_expression and it's about to be your new fave π«Ά
β¨ NAME β¨
ausearch_add_expression β build up search expression π§
πΈ SYNOPSIS πΈ
#include <auparse.h>
int ausearch_add_expression(auparse_state_t *au, const char *expression, char **error, ausearch_rule_t how);"
yes the stray " at the end is in the original, we don't touch it, we respect the lore π
π¦ DESCRIPTION π¦
okay so here's the tea: ausearch_add_item adds an expression to the current audit search expression. (yes, the page really says ausearch_add_item there even though we're all here for ausearch_add_expression β that's what it says, so that's what you get, no cap.) Once that's done, the search conditions can be used to scan logs, files, or buffers for something of interest. so basically you're setting up the vibe check that later decides what counts as a match πβ¨
the expression parameter contains an expression, as specified in ausearch-expression(5) β go read that one too, iykyk.
the how parameter determines how this search expression will affect the existing search expression, if one is already defined. the possible values are, and bestie, listen closely:
AUSEARCH_RULE_CLEARβ clear the current search expression, if any, and use only this search expression. it's giving fresh start, clean slate, main character energy β¨AUSEARCH_RULE_ORβ if a search expressionEis already configured, replace it by(E || this_search_expression). so it's the "or" girlie, either one works, we're flexible πAUSEARCH_RULE_ANDβ if a search expressionEis already configured, replace it by(E && this_search_expression). and this one is the "and" girlie, both conditions gotta hit, no exceptions π
the caller must free the error message using free(3). not optional, not a suggestion, that's your homework π
if an error message is not available or can not be allocated, *error is set to NULL.
π SEE ALSO π
go read these too, they're all part of the friend group fr fr:
ausearch_add_item(3)ausearch_add_interpreted_item(3)ausearch_add_timestamp_item(3)ausearch_add_regex(3)ausearch_set_stop(3)ausearch_clear(3)ausearch_next_event(3)ausearch_cur_event(3)ausearch-expression(5)
π AUTHOR π
Miloslav Trmac β thank you king π
and that's the whole page bestie!! this lil gem is from Red Hat, dated Feb 2008 β vintage but still eating, we love to see it πβ¨ππ¦πΈπ π«Ά
π¦ 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