1AUSEARCH:(8) System Administration Utilities AUSEARCH:(8)
2
3
4
6 ausearch - a tool to query audit daemon logs
7
9 ausearch [options]
10
12 ausearch is a tool that can query the audit daemon logs based for
13 events based on different search criteria. The ausearch utility can
14 also take input from stdin as long as the input is the raw log data.
15 Each commandline option given forms an "and" statement. For example,
16 searching with -m and -ui means return events that have both the
17 requested type and match the user id given. An exception is the -n
18 option; multiple nodes are allowed in a search which will return any
19 matching node.
20
21 It should also be noted that each syscall excursion from user space
22 into the kernel and back into user space has one event ID that is
23 unique. Any auditable event that is triggered during this trip share
24 this ID so that they may be correlated.
25
26 Different parts of the kernel may add supplemental records. For exam‐
27 ple, an audit event on the syscall "open" will also cause the kernel to
28 emit a PATH record with the file name. The ausearch utility will
29 present all records that make up one event together. This could mean
30 that even though you search for a specific kind of record, the result‐
31 ing events may contain SYSCALL records.
32
33 Also be aware that not all record types have the requested information.
34 For example, a PATH record does not have a hostname or a loginuid.
35
36
38 -a, --event audit-event-id
39 Search for an event based on the given event ID. Messages always
40 start with something like msg=audit(1116360555.329:2401771). The
41 event ID is the number after the ':'. All audit events that are
42 recorded from one application's syscall have the same audit
43 event ID. A second syscall made by the same application will
44 have a different event ID. This way they are unique.
45
46 -c, --comm comm-name
47 Search for an event based on the given comm name. The comm name
48 is the executable's name from the task structure.
49
50 -e, --exit exit-code-or-errno
51 Search for an event based on the given syscall exit code or
52 errno.
53
54 -f, --file file-name
55 Search for an event based on the given filename.
56
57 -ga, --gid-all all-group-id
58 Search for an event with either effective group ID or group ID
59 matching the given group ID.
60
61 -ge, --gid-effective effective-group-id
62 Search for an event with the given effective group ID or group
63 name.
64
65 -gi, --gid group-id
66 Search for an event with the given group ID or group name.
67
68 -h, --help
69 Help
70
71 -hn, --host host-name
72 Search for an event with the given host name. The hostname can
73 be either a hostname, fully qualified domain name, or numeric
74 network address. No attempt is made to resolve numeric addresses
75 to domain names or aliases.
76
77 -i, --interpret
78 Interpret numeric entities into text. For example, uid is con‐
79 verted to account name. The conversion is done using the current
80 resources of the machine where the search is being run. If you
81 have renamed the accounts, or don't have the same accounts on
82 your machine, you could get misleading results.
83
84 -if, --input file-name
85 Use the given file instead of the logs. This is to aid analysis
86 where the logs have been moved to another machine or only part
87 of a log was saved.
88
89 --input-logs
90 Use the log file location from auditd.conf as input for search‐
91 ing. This is needed if you are using ausearch from a cron job.
92
93 --just-one
94 Stop after emitting the first event that matches the search cri‐
95 teria.
96
97 -k, --key key-string
98 Search for an event based on the given key string.
99
100 -l, --line-buffered
101 Flush output on every line. Most useful when stdout is connected
102 to a pipe and the default block buffering strategy is undesir‐
103 able. May impose a performance penalty.
104
105 -m, --message message-type | comma-sep-message-type-list
106 Search for an event matching the given message type. You may
107 also enter a comma separated list of message types. There is an
108 ALL message type that doesn't exist in the actual logs. It
109 allows you to get all messages in the system. The list of valid
110 messages types is long. The program will display the list when‐
111 ever no message type is passed with this parameter. The message
112 type can be either text or numeric. If you enter a list, there
113 can be only commas and no spaces separating the list.
114
115 -n, --node node-name
116 Search for events originating from node name string. Multiple
117 nodes are allowed, and if any nodes match, the event is matched.
118
119 -o, --object SE-Linux-context-string
120 Search for event with tcontext (object) matching the string.
121
122 -p, --pid process-id
123 Search for an event matching the given process ID.
124
125 -pp, --ppid parent-process-id
126 Search for an event matching the given parent process ID.
127
128 -r, --raw
129 Output is completely unformatted. This is useful for extracting
130 records that can still be interpreted by audit tools.
131
132 -sc, --syscall syscall-name-or-value
133 Search for an event matching the given syscall. You may either
134 give the numeric syscall value or the syscall name. If you give
135 the syscall name, it will use the syscall table for the machine
136 that you are using.
137
138 -se, --context SE-Linux-context-string
139 Search for event with either scontext/subject or tcontext/object
140 matching the string.
141
142 --session Login-Session-ID
143 Search for events matching the given Login Session ID. This
144 process attribute is set when a user logs in and can tie any
145 process to a particular user login.
146
147 -su, --subject SE-Linux-context-string
148 Search for event with scontext (subject) matching the string.
149
150 -sv, --success success-value
151 Search for an event matching the given success value. Legal val‐
152 ues are yes and no.
153
154 -te, --end [end-date] [end-time]
155 Search for events with time stamps equal to or before the given
156 end time. The format of end time depends on your locale. If the
157 date is omitted, today is assumed. If the time is omitted, now
158 is assumed. Use 24 hour clock time rather than AM or PM to spec‐
159 ify time. An example date using the en_US.utf8 locale is
160 09/03/2009. An example of time is 18:00:00. The date format
161 accepted is influenced by the LC_TIME environmental variable.
162
163 You may also use the word: now, recent, today, yesterday,
164 this-week, week-ago, this-month, this-year. Today means starting
165 now. Recent is 10 minutes ago. Yesterday is 1 second after mid‐
166 night the previous day. This-week means starting 1 second after
167 midnight on day 0 of the week determined by your locale (see
168 localtime). This-month means 1 second after midnight on day 1 of
169 the month. This-year means the 1 second after midnight on the
170 first day of the first month.
171
172 -ts, --start [start-date] [start-time]
173 Search for events with time stamps equal to or after the given
174 end time. The format of end time depends on your locale. If the
175 date is omitted, today is assumed. If the time is omitted, mid‐
176 night is assumed. Use 24 hour clock time rather than AM or PM to
177 specify time. An example date using the en_US.utf8 locale is
178 09/03/2009. An example of time is 18:00:00. The date format
179 accepted is influenced by the LC_TIME environmental variable.
180
181 You may also use the word: now, recent, today, yesterday,
182 this-week, this-month, this-year. Today means starting at 1 sec‐
183 ond after midnight. Recent is 10 minutes ago. Yesterday is 1
184 second after midnight the previous day. This-week means starting
185 1 second after midnight on day 0 of the week determined by your
186 locale (see localtime). This-month means 1 second after midnight
187 on day 1 of the month. This-year means the 1 second after mid‐
188 night on the first day of the first month.
189
190 -tm, --terminal terminal
191 Search for an event matching the given terminal value. Some dae‐
192 mons such as cron and atd use the daemon name for the terminal.
193
194 -ua, --uid-all all-user-id
195 Search for an event with either user ID, effective user ID, or
196 login user ID (auid) matching the given user ID.
197
198 -ue, --uid-effective effective-user-id
199 Search for an event with the given effective user ID.
200
201 -ui, --uid user-id
202 Search for an event with the given user ID.
203
204 -ul, --loginuid login-id
205 Search for an event with the given login user ID. All entry
206 point programs that are pamified need to be configured with
207 pam_loginuid required for the session for searching on loginuid
208 (auid) to be accurate.
209
210 -v, --version
211 Print the version and exit
212
213 -w, --word
214 String based matches must match the whole word. This category of
215 matches include: filename, hostname, terminal, and SE Linux con‐
216 text.
217
218 -x, --executable executable
219 Search for an event matching the given executable name.
220
221
223 auditd(8), pam_loginuid(8).
224
225
226
227Red Hat Sept 2009 AUSEARCH:(8)