'\" t
.\" Title: \fBmysqlauditadmin\fR
.\" Author: [FIXME: author] [see http://docbook.sf.net/el/author]
.\" Generator: DocBook XSL Stylesheets v1.78.1
.\" Date: 08/30/2013
.\" Manual: MySQL Utilities
.\" Source: MySQL 1.3.4
.\" Language: English
.\"
.TH "\FBMYSQLAUDITADMIN\F" "1" "08/30/2013" "MySQL 1\&.3\&.4" "MySQL Utilities"
.\" -----------------------------------------------------------------
.\" * Define some portability stuff
.\" -----------------------------------------------------------------
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.\" http://bugs.debian.org/507673
.\" http://lists.gnu.org/archive/html/groff/2009-02/msg00013.html
.\" ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
.ie \n(.g .ds Aq \(aq
.el .ds Aq '
.\" -----------------------------------------------------------------
.\" * set default formatting
.\" -----------------------------------------------------------------
.\" disable hyphenation
.nh
.\" disable justification (adjust text to left margin only)
.ad l
.\" -----------------------------------------------------------------
.\" * MAIN CONTENT STARTS HERE *
.\" -----------------------------------------------------------------
.\" mysqlauditadmin
.\" utilities: mysqlauditadmin
.\" scripts
.SH "NAME"
mysqlauditadmin \- Maintain the audit log
.SH "SYNOPSIS"
.\".HP \w'\fBmysqlauditadmin\ [\fR\fB\fIOPTIONS\fR\fR\fB]\&.\&.\&.\ \fR\fBmysqlauditadmin\ [\fR\fB\fIOPTIONS\fR\fR\fB]\&.\&.\&.\ [\fR\fB\fICOMMAND\fR\fR\fB]\fR\fBmysqlauditadmin\ l=\fR\fB\fIuser:pass@host:port\fR\fR\fB\ [\fR\fB\fIOPTIONS\fR\fR\fB]\&.\&.\&.\ [\fR\fB\fICOMMAND\fR\fR\fB[\-\-value=\fR\fB\fIVALUE\fR\fR\fB]]\fR\fBmysqlauditadmin\ \-\-file\-stats\ \-\-audit\-log\-name=\fR\fB\fIFULL_PATH\fR\fR\fBmysqlauditadmin\ copy\ \-\-audit\-log\-name=\fR\fB\fIFULL_PATH\fR\fR\fB\ \-\-copy\-to=\fR\fB\fIDESTINATION\fR\fR\fB\ [\-\-remote\-login=\fR\fB\fIuser:host\fR\fR\fB]\fR\ 'u
\fBmysqlauditadmin [\fR\fB\fIOPTIONS\fR\fR\fB]\&.\&.\&. \fR
\fBmysqlauditadmin [\fR\fB\fIOPTIONS\fR\fR\fB]\&.\&.\&. [\fR\fB\fICOMMAND\fR\fR\fB]\fR
\fBmysqlauditadmin l=\fR\fB\fIuser:pass@host:port\fR\fR\fB [\fR\fB\fIOPTIONS\fR\fR\fB]\&.\&.\&. [\fR\fB\fICOMMAND\fR\fR\fB[\-\-value=\fR\fB\fIVALUE\fR\fR\fB]]\fR
\fBmysqlauditadmin \-\-file\-stats \-\-audit\-log\-name=\fR\fB\fIFULL_PATH\fR\fR
\fBmysqlauditadmin copy \-\-audit\-log\-name=\fR\fB\fIFULL_PATH\fR\fR\fB \-\-copy\-to=\fR\fB\fIDESTINATION\fR\fR\fB [\-\-remote\-login=\fR\fB\fIuser:host\fR\fR\fB]\fR
.SH "DESCRIPTION"
.PP
This utility allow you to maintain the
\m[blue]\fBaudit log\fR\m[]\&\s-2\u[1]\d\s+2, allowing you to monitor the audit log file growth and control its rotation\&. Rotation refers to the action of replacing the current audit log file by a new one for continuous use, renaming (with a timestamp extension) and copying the previously used audit log file to a defined location\&.
.PP
This utility allows you to view and modify a subset of audit log control variables, display the audit log file status, perform on\-demand rotation of the log file, and copy files to other locations\&. These features enable you to easily monitor the audit log file growth and control its rotation (automatically based on the defined file size threshold, or manually by a on\-demand command)\&.
.PP
The available actions include the following:
.sp
.RS 4
.ie n \{\
\h'-04' 1.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 1." 4.2
.\}
\fBcopy\fR
.sp
This command copies the audit log specified by
\fB\-\-audit\-log\-name\fR
to the destination path specified by
\fB\-\-copy\-to\fR\&. The
\fB\-\-remote\-login\fR
option can be used to copy log files from a remote location\&. Note: the destination path must be locally accessible by the current user\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 2.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 2." 4.2
.\}
\fBpolicy\fR
.sp
The policy command is used to change the audit logging policy\&. The accepted values are the following, which are set using the
\fB\-\-value\fR
option\&.
.if n \{\
.sp
.\}
.RS 4
.it 1 an-trap
.nr an-no-space-flag 1
.nr an-break-flag 1
.br
.ps +1
\fBNote\fR
.ps -1
.br
The
\fB\-\-server\fR
option is also required to execute this command\&.
.sp .5v
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
ALL: log all events
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
NONE: log nothing
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
LOGINS: only log login events
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
QUERIES: only log query events
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
DEFAULT: sets the default log policy
.RE
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 3.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 3." 4.2
.\}
\fBrotate_on_size\fR
.sp
This command sets the file size threshold for automatic rotation of the audit log (the
audit_log_rotate_on_size
variable)\&. The value is set using the
\fB\-\-value\fR
option, and must be in the range (0, 4294967295)\&. This command also requires the
\fB\-\-server\fR
option to be specified\&. Note: if the variable is set with a value that is not a multiple of 4096, then it is truncated to the nearest multiple\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04' 4.\h'+01'\c
.\}
.el \{\
.sp -1
.IP " 4." 4.2
.\}
\fBrotate\fR
.sp
This command is used to perform an on\-demand audit log rotation, and only requires the
\fB\-\-server\fR
option to be passed\&. Note: this command has no effect if the audit log file size is smaller than 4096, which is the minimum value allowed that is greater than 0 for the
audit_log_rotate_on_size variable
variable)\&.
.RE
OPTIONS
.PP
\fBmysqlauditadmin\fR
accepts the following command\-line options:
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-audit\-log\-name=
.sp
Full path and file name for the audit log file\&. Used by the
\fB\-\-file\-stats\fR
option, and the
\fIcopy\fR
command\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-copy\-to=
.sp
The location to copy the specified audit log file\&. The path must be locally accessible for the current user\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-file\-stats
.sp
Display the audit log file statistics\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-help
.sp
Display a help message and exit\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-remote\-login=
.sp
User name and host to be used for the remote login, for copying log files\&. It is defined using the following format: <\fIuser\fR>:<\fIhost or IP\fR>\&. Usage will prompt for the password\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-server=
.sp
Connection information for the server in the format: <\fIuser\fR>[:<\fIpasswd\fR>]@<\fIhost\fR>[:<\fIport\fR>][:<\fIsocket\fR>] or <\fIlogin\-path\fR>[:<\fIport\fR>][:<\fIsocket\fR>]\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-show\-options
.sp
Display the audit log system variables\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-value=
.sp
Value used to set variables based on the specified commands, such as
\fIpolicy\fR
and
\fIrotate_on_size\fR\&.
.RE
.sp
.RS 4
.ie n \{\
\h'-04'\(bu\h'+03'\c
.\}
.el \{\
.sp -1
.IP \(bu 2.3
.\}
\-\-server1=