AUSEARCH-EXPRESSION

NAME
OVERVIEW
LEXICAL STRUCTURE
EXPRESSION SYNTAX
VIRTUAL FIELDS
SEMANTICS
EXAMPLES
FUTURE DIRECTIONS
AUTHOR

NAME

ausearch-expression − audit search expression format

OVERVIEW

This man page describes the format of "ausearch expressions". Parsing and evaluation of these expressions is provided by libauparse and is common to applications that use this library.

LEXICAL STRUCTURE

White space (ASCII space, tab and new-line characters) between tokens is ignored. The following tokens are recognized:
Punctuation

( ) \

Logical operators

! && ||

Comparison operators

< <= == > >= !== i= i!= r= r!=

Unquoted strings

Any non-empty sequence of ASCII letters, digits, and the _ symbol.

Quoted strings

A sequence of characters surrounded by the " quotes. The \ character starts an escape sequence. The only defined escape sequences are \\ and \". The semantics of other escape sequences is undefined.

Regexps

A sequence of characters surrounded by the / characters. The \ character starts an escape sequence. The only defined escape sequences are \\ and \/. The semantics of other escape sequences is undefined.

Anywhere an unquoted string is valid, a quoted string is valid as well, and vice versa. In particular, field names may be specified using quoted strings, and field values may be specified using unquoted strings.

EXPRESSION SYNTAX

The primary expression has one of the following forms:

field comparison-operator value

\regexp string-or-regexp

field is either a string, which specifies the first field with that name within the current audit record, or the \ escape character followed by a string, which specifies a virtual field with the specified name (virtual fields are defined in a later section).

field is a string. operator specifies the comparison to perform

r= r!=

Get the "raw" string of field, and compare it to value. For fields in audit records, the "raw" string is the exact string stored in the audit record (with all escaping and unprintable character encoding left alone); applications can read the "raw" string using auparse_get_field_str(3). Each virtual field may define a "raw" string. If field is not present or does not define a "raw" string, the result of the comparison is false (regardless of the operator).

i= i!=

Get the "interpreted" string of field, and compare it to value. For fields in audit records, the "interpreted" string is an "user-readable" interpretation of the field value; applications can read the "interpreted" string using auparse_interpret_field(3). Each virtual field may define an "interpreted" string. If field is not present or does not define an "interpreted" string, the result of the comparison is false (regardless of the operator).

< <= == > >= !==

Evaluate the "value" of field, and compare it to value. A "value" may be defined for any field or virtual field, but no "value" is currently defined for any audit record field. The rules of parsing value for comparing it with the "value" of field are specific for each field. If field is not present, the result of the comparison is false (regardless of the operator). If field does not define a "value", an error is reported when parsing the expression.

In the special case of \regexp regexp-or-string, the current audit record is taken as a string (without interpreting field values), and matched against regexp-or-string. regexp-or-string is an extended regular expression, using a string or regexp token (in other words, delimited by " or /).

If E1 and E2 are valid expressions, then ! E1, E1 && E2, and E1 || E2 are valid expressions as well, with the usual C semantics and evaluation priorities. Note that ! field op value is interpreted as !(field op value), not as (!field) op value.

VIRTUAL FIELDS

The following virtual fields are defined:
\timestamp

The value is the timestamp of the current event. value must have the ts:seconds.milli format, where seconds and milli are decimal numbers specifying the seconds and milliseconds part of the timestamp, respectively.

\record_type

The value is the type of the current record. value is either the record type name, or a decimal number specifying the type.

SEMANTICS

The expression as a whole applies to a single record. The expression is true for a specified event if it is true for any record associated with the event.

EXAMPLES

As a demonstration of the semantics of handling missing fields, the following expression is true if field is present:

(field r= "") || (field r!= "")

and the same expression surrounded by !( and ) is true if field is not present.

FUTURE DIRECTIONS

New escape sequences for quoted strings may be defined.

For currently defined virtual fields that do not define a "raw" or "interpreted" string, the definition may be added. Therefore, don’t rely on the fact that comparing the "raw" or "interpreted" string of the field with any value is false.

New formats of value constants for the \timestamp virtual field may be added.

AUTHOR

Miloslav Trmac


Open Source


US Navy - The US Navy's most advanced warship is powered by Linux. The next generation warship is a guided missile destroyer. It uses Red Hat Enterprise Linux along with Fedora as its operating systems. The Navy also utilizes Linux to run it's drone fleet. Government use of open source continues to expand.

5 Billion Dollars of Free Software - The Linux Foundation released a report estimating the value of their open source projects at 5 billion. This software is yours for free. Governments and large corporations are using this incredible gift to their advantage every day. Learn how open source can benefit you.

Financial Opportunity - Everyone has free and unlimited access to billions of dollars of sofware. The only cost is the knowledge of how to use it. Everyone should understand the opportunity and share the knowledge. Free software is the unhidden secret that provides unlimited opportunity.

Harvard - MIT - Stanford - The open edX platform delivers free online courses from Harvard, MIT, Columbia, UC Berkeley and other top Universities. Hundreds of courses are available and include almost all major subject areas and course levels. Paid courses and certifications are also available.

Free Office Software - The Libre Office Suite is available for Linux or Windows and incldues, Writer, the word processor, Calc, the spreadsheet application, Impress, the presentation engine, Draw, our drawing and flowcharting application, Base, our database and database frontend, and Math for editing mathematics.

What is Linux - Linux is a computer operating system (OS) that is free and open-source software. The software that runs the computer and the source code used to create it are both available to you at no cost. Linux is used on games, watches, laptops, desktops and super computers. The capability to operate and create on these devices is available to you.

ConnectED and edX - President Obama announced on November 2014, that edX and ConnectED will partner to deliver teacher training and AP courses. ConnectED is the President's initiative to enhance K-12 through the delivery of broadband access and digital content.

Free Technology Academy - The FTA provides a virtual campus offering course modules on Free Software and Open Standards. Educational materials in the FTA are released under free licenses. FTA is constructed on a Free Software OS and utilizes Free Software and standards to deliver its services.

Open Opportunity - Free and Open Source software provide unlimited potential for personal and community development. Use open source to build a career, establish a business or change the world. Learn why free software provides the greatest opportunity on the the planet today.

College Prep - Get ready for college or earn college credit. EdX provides more than 40 High School and AP Exam Preparation Courses. Subjects range from mathematics to science, English and history. EdX courses help students succeed in High School and prepare for college. pre-calc calculus

bash - Bash is both a command interpreter and a programming language. As a command interpreter, bash provides the user interface to the rich set of GNU utilities. The programming language features allow these utilities to be combined. Mastering a shell such as bash is important for anyone learning Linux.

Competitive Advantage - Goldman Sachs, IBM and countless large corporations are leveraging open source to reduce costs, develop products and increase their bottom lines. Learn what these companies think about open source and how open source can give you the competitive advantage.

President Obama Knows Open Source - On January 20 2009, President Obama's first day in office, the Open Government initiative was issued to provide transparency and access to Government data. Learn how our Government is using open source and the opportunities this provides for you.

bash - Bash is both a command interpreter and a programming language. As a command interpreter, bash provides the user interface to the rich set of GNU utilities. The programming language features allow these utilities to be combined. Mastering a shell such as bash is important for anyone learning Linux.

More Linux Commands


lmtp (8)             - Postfix SMTP+LMTP client
The Postfix SMTP+LMTP client implements the SMTP and LMTP mail delivery protocols. It processes message delivery requests from the queue manager. Each request s...

fuser (1)            - identify processes using files or sockets
fuser displays the PIDs of processes using the specified files or file systems. In the default display mode, each file name is followed by a letter denoting the...

vmsplice (2)         - splice user pages into a pipe
The vmsplice() system call maps nr_segs ranges of user memory described by iov into a pipe. The file descriptor fd must refer to a pipe. The pointer iov points...

gnutls_x509_crt_get_dn_oid (3) - API function
This function will extract the OIDs of the name of the Certificate subject specified by the given index. If oid is null then only the size will be filled. If th...

ntfsfix (8)          - fix common errors and force Windows to check NTFS
ntfsfix is a utility that fixes some common NTFS problems. ntfsfix is NOT a Linux version of chkdsk. It only repairs some fundamental NTFS inconsistencies, rese...

appres (1)           - list X application resource database
The appres program prints the resources seen by an application (or subhierarchy of an application) with the specified class and instance names. It can be used t...

FcPatternGet-Type (3) - Return a typed value from a pattern
These are convenience functions that call FcPatternGet and verify that the returned data is of the expected type. They return FcResultTypeMismatch if this is no...

svndumpfilter (1)    - Filter a subversion repository ’dumpfile’.
svndumpfilter.1 - Subversion is a version control system, which allows you to keep old versions of files and directories (usually source code), keep a log of wh...

feature (3pm)        - Perl pragma to enable new features
It is usually impossible to add new syntax to Perl without breaking some existing programs. This pragma provides a way to minimize that risk. New syntactic cons...

pam_authenticate (3) - account authentication
The pam_authenticate function is used to authenticate the user. The user is required to provide an authentication token depending upon the authentication servic...

kbruch (1)           - Learn calculating with fractions
KBruch is a small program to practice calculating with fractions. Different exercises are provided for this purpose. The program checks users input and gives fe...

rmiregistry-java-1.7.0-openjdk (1) - The Java Remote Object Registry
rmiregistry-java-1.7.0-openjdk.1 - The rmiregistry command creates and starts a remote object registry on the specified port on the current host. If port is omi...

Mail::SpamAssassin::Plugin::Rule2XSBody (3pm) - speed up SpamAssassin by comp...
This plugin will use native-code object files representing the ruleset, in order to provide significant speedups in rule evaluation. Note that sa-compile must b...

nearbyint (3)        - round to nearest integer
The nearbyint(), nearbyintf(), and nearbyintl() functions round their argument to an integer value in floating-point format, using the current rounding directio...

config (5ssl)        - OpenSSL CONF library configuration files
The OpenSSL CONF library can be used to read configuration files. It is used for the OpenSSL master configuration file openssl.cnf and in a few other places lik...