Debian Codegraph @

upstream/debian-unstable/man3/ausearch_add_item.3

raw
1 .TH "AUSEARCH_ADD_ITEM" "3" "Feb 2012" "Red Hat" "Linux Audit API"
2 .SH NAME
3 ausearch_add_item \- build up search rule
4 .SH "SYNOPSIS"
5 .nf
6 .B #include <auparse.h>
7 .PP
8 .BI "int ausearch_add_item(auparse_state_t *" au ", const char *" field ", const char *" op ", const char *" value ", ausearch_rule_t " how );"
9 .fi
10
11 .SH "DESCRIPTION"
12
13 ausearch_add_item adds one search condition to the current audit search expression. The search conditions can then be used to scan logs, files, or buffers for something of interest. The \fIfield\fP value is the field name that the \fIvalue\fP will be checked for. The \fIop\fP variable describes what kind of check is to be done. Legal \fIop\fP values are:
14
15 .RS
16 .TP
17 .I "exists"
18 just check that a field name exists
19 .TP
20 .I "="
21 locate the field name and check that the value associated with it is equal to the value given in this rule.
22 .TP
23 .I "!="
24 locate the field name and check that the value associated with it is NOT equal to the value given in this rule.
25 .RE
26
27 The value parameter is compared to the uninterpreted field value. If you are trying to match against a field who's type is AUPARSE_TYPE_ESCAPED, you will want to use the ausearch_add_interpreted_item() function instead.
28
29 The \fIhow\fP value determines how this search condition will affect the existing search expression if one is already defined. The possible values are:
30 .RS
31 .TP
32 .I AUSEARCH_RULE_CLEAR
33 Clear the current search expression, if any, and use only this search condition.
34 .TP
35 .I AUSEARCH_RULE_OR
36 If a search expression
37 .I E
38 is already configured, replace it by \fB(\fIE\fB || \fIthis_search_condition\fB)\fR.
39 .TP
40 .I AUSEARCH_RULE_AND
41 If a search expression
42 .I E
43 is already configured, replace it by \fB(\fIE\fB && \fIthis_search_condition\fB)\fR.
44 .RE
45
46 .SH "RETURN VALUE"
47
48 Returns \-1 if an error occurs; otherwise, 0 for success.
49
50 .SH "SEE ALSO"
51
52 .BR ausearch_add_expression (3),
53 .BR ausearch_add_interpreted_item (3),
54 .BR ausearch_add_timestamp_item (3),
55 .BR ausearch_add_regex (3),
56 .BR ausearch_set_stop (3),
57 .BR ausearch_clear (3),
58 .BR ausearch_next_event (3),
59 .BR ausearch_cur_event (3),
60 .BR ausearch\-expression (5).
61
62 .SH AUTHOR
63 Steve Grubb