AUSEARCH_ADD_ITEM(3)
π AUSEARCH_ADD_ITEM(3) β Linux Audit API π
okay bestie, so this one's from the Linux Audit API family, manual section 3, and it's literally the function that lets you build up a search rule, one lil condition at a time. iconic behavior honestly π
β¨ NAME β¨
ausearch_add_item β build up search rule π¦
πΈ SYNOPSIS πΈ
#include <auparse.h>
int ausearch_add_item(auparse_state_t *au, const char *field, const char *op, const char *value, ausearch_rule_t how);
π DESCRIPTION π
so ausearch_add_item adds one search condition to the current audit search expression. that's it, that's the job. then once you've stacked up your conditions, you can use them to scan logs, files, or buffers for something of interest. main character energy fr fr β¨
the field value is the field name that the value is gonna get checked for. like, what are we even looking at here.
the op variable describes what kind of check is to be done. the legal op values are:
existsβ just check that a field name exists. that's all, no value drama, we're just vibing and confirming it's there π=β locate the field name and check that the value associated with it is equal to the value given in this rule. matchy matchy π!=β locate the field name and check that the value associated with it is NOT equal to the value given in this rule. respectfully, we do not want it π
the value parameter is compared to the uninterpreted field value. so heads up: if you're trying to match against a field whose type is AUPARSE_TYPE_ESCAPED, you will want to use the ausearch_add_interpreted_item() function instead. not me giving you the right tool for the right job π«Ά
the how value determines how this search condition will affect the existing search expression if one is already defined. the possible values are:
AUSEARCH_RULE_CLEARβ clear the current search expression, if any, and use only this search condition. fresh start, clean slate, no baggage β¨AUSEARCH_RULE_ORβ if a search expressionEis already configured, replace it by(E || this_search_condition). either/or, we're flexible like that πAUSEARCH_RULE_ANDβ if a search expressionEis already configured, replace it by(E && this_search_condition). both. it has to be both. no negotiation π₯
π RETURN VALUE π
returns -1 if an error occurs; otherwise, 0 for success. so like, -1 is giving π and 0 is giving π.
π¦ SEE ALSO π¦
ausearch_add_expression(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 π
Steve Grubb
okay that's the whole page bestie, slay π
this one's Red Hat, dated Feb 2012, and it lives at AUSEARCH_ADD_ITEM(3) in the Linux Audit API section β go forth and build those search rules, periodt πΈπ¦π
π¦ 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