Imported Upstream version 2.4.3
[platform/upstream/audit.git] / docs / ausearch_add_interpreted_item.3
1 .TH "AUSEARCH_ADD_INTERPRETED_ITEM" "3" "Nov 2007" "Red Hat" "Linux Audit API"
2 .SH NAME
3 ausearch_add_interpreted_item \- build up search rule
4 .SH "SYNOPSIS"
5 .B #include <auparse.h>
6 .sp
7 int ausearch_add_interpreted_item(auparse_state_t *au, const char *field, const char *op, const char *value, ausearch_rule_t how);
8
9 .SH "DESCRIPTION"
10
11 ausearch_add_interpreted_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 field value is the field name that the value will be checked for. The op variable describes what kind of check is to be done. Legal op values are:
12
13 .RS
14 .TP
15 .I "exists"
16  just check that a field name exists
17 .TP
18 .I "="
19  locate the field name and check that the value associated with it is equal to the value given in this rule.
20 .TP
21 .I "!="
22  locate the field name and check that the value associated with it is NOT equal to the value given in this rule.
23 .RE
24
25 The value parameter is compared to the interpreted field value (the value that would be returned by \fBauparse_interpret_field\fR(3)).
26
27 The how value determines how this search condition will affect the existing search expression if one is already defined. The possible values are:
28 .RS
29 .TP
30 .I AUSEARCH_RULE_CLEAR
31 Clear the current search expression, if any, and use only this search condition.
32 .TP
33 .I AUSEARCH_RULE_OR
34 If a search expression
35 .I E
36 is already configured, replace it by \fB(\fIE\fB || \fIthis_search_condition\fB)\fR.
37 .TP
38 .I AUSEARCH_RULE_AND
39 If a search expression
40 .I E
41 is already configured, replace it by \fB(\fIE\fB && \fIthis_search_condition\fB)\fR.
42 .RE
43
44 .SH "RETURN VALUE"
45
46 Returns \-1 if an error occurs; otherwise, 0 for success.
47
48 .SH "SEE ALSO"
49
50 .BR ausearch_add_expression (3),
51 .BR ausearch_add_item (3),
52 .BR ausearch_add_timestamp_item (3),
53 .BR ausearch_add_regex (3),
54 .BR ausearch_set_stop (3),
55 .BR ausearch_clear (3),
56 .BR ausearch_next_event (3),
57 .BR ausearch\-expression (5).
58
59 .SH AUTHOR
60 Steve Grubb