AUSEARCH_ADD_TIMESTAMP_ITEM(3)
π AUSEARCH_ADD_TIMESTAMP_ITEM(3) π
okay bestie, welcome to the Linux Audit API corner of the group chat β¨ this one's ausearch_add_timestamp_item, and she's literally the moment you want to build a search rule based on when stuff happened π°οΈ
πΈ NAME πΈ
ausearch_add_timestamp_item β build up search rule π«Ά
β¨ SYNOPSIS β¨
#include <auparse.h>
int ausearch_add_timestamp_item(auparse_state_t *au, const char *op, time_t sec,
unsigned milli, ausearch_rule_t how);
π¦ DESCRIPTION π¦
so ausearch_add_timestamp_item adds an event time condition to the current audit search expression, no biggie π
and like β once you've got your search conditions stacked up, you can use them to scan logs, files, or buffers for something of interest π iconic behaviour honestly.
the op parameter is the vibe check on the comparison β it says which comparison you want. the legal op values are:
<<=>=>=
and just so we're clear on the math, bestie: the left operand of the comparison operator is the timestamp of the examined event, and the right operand is whatever you passed in through the sec and milli parameters. that's the whole setup π
now, the how value is the one that decides how this search condition is gonna affect the search expression you've already got going, if one's already defined. the possible values are:
AUSEARCH_RULE_CLEARβ clears the current search expression, if any, and uses only this search condition. like a clean slate, periodt π§ΉAUSEARCH_RULE_ORβ if a search expression E is already configured, it gets replaced by(E || this_search_condition). two vibes, either one works πAUSEARCH_RULE_ANDβ if a search expression E is already configured, it gets replaced by(E && this_search_condition). both or nothing, no cap π₯
π« RETURN VALUE π«
returns -1 if an error occurs; otherwise, 0 for success. that's it, that's the whole story π
π APPLICATION USAGE π
use ausearch_add_item(3) and ausearch_add_interpreted_item(3) when you wanna add conditions that check audit record fields instead. and use ausearch_add_expression(3) if you wanna add complex search expressions in one single function call β one call, whole fit, slay π
π SEE ALSO π
ausearch_add_expression(3)ausearch_add_item(3)ausearch_add_interpreted_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 π«Ά
and that's a wrap, bestie!! this little masterpiece came to you courtesy of Red Hat, back in Aug 2014, and yes she's still serving under the name AUSEARCH_ADD_TIMESTAMP_ITEM(3) π go forth and timestamp responsibly, ily πβ¨
π¦ 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