Audit Log File Format
On this page
Warning
As of the time of this publication, audit logging features are made available and licensed only as part of the SingleStore Enterprise edition.
Audit logs are written to the directory specified by the auditlogsdir variable.
Each node in a cluster will create its own files in the destination directory using the following naming convention:
auditlog_<hostname>-<port>_<year>-<month>-<day>_<hour>-<minute>-<second>.logFor example, consider the following log file name:
auditlog_myVmbox-3306_2016-08-30_06-38-46.logIf a log file’s rotation size is very small, an auto-incrementing integer may be appended to the end of the log file.
auditlog_myVmbox-3306_2016-08-30_06-38-46_1.log
auditlog_myVmbox-3306_2016-08-30_06-38-46_2.log
auditlog_myVmbox-3306_2016-08-30_06-38-46_3.logData within the log file is written in comma-separated values (CSV) format.
The auditlog_ engine variable controls whether the audit is written to disk synchronously.
Log Entry File Schemas
The following sections describe the corresponding record schema for each audit log type.
First Line Schema
The first line of a log file has a unique schema that describes the event or action that resulted in the creation of a new log file.
<id>,<time>,INFO: <origin>. <version>. <action>
|
Field |
Description |
|---|---|
|
|
Represents the unique identifier for the log entry within the scope of a single log file. |
|
|
Specifies the local system time when the file was opened or rotated, using the same timestamp formatting as other audit log records. |
|
|
Describes the reason or event that caused the creation of the log file.
|
|
|
Specifies current audit logging format version. |
|
|
Describes the audit logging state associated with the new file.
|
For example:
0,2026-06-21 18:49:25.888,INFO: Log opened on MemSQL startup. Format version 4. Logging at level ADMIN-ONLY-INCLUDING-PARSE-FAILS
Login and Logout Schema
Each login attempt and logout event is logged using the following schema:
Note
The logout event log schema does not contain the authtype and status fields.
<id>,<time>,<timezone>,<endpoint>,<nodetype:agg|leaf>,<type:USER_LOGIN|USER_LOGOUT>,<threadid>,<username>,<remotehost>,<usergrant:grant_user@grant_host>,<authtype>,<status:SUCCESS|FAILURE: reason>,<tlscipher>,<appname>,<osuser>
|
Field |
Description |
|---|---|
|
|
Represents the unique identifier for the log entry within the scope of a single log file. |
|
|
Specifies the node’s local system time when an operation was executed. |
|
|
Specifies the local time zone when the event was logged. |
|
|
Specifies the hostname or IP address of the SingleStore cluster in the |
|
|
Specifies the type of node.
|
|
|
Specifies the login or logout event type.
|
|
|
Specifies the ID of the thread that is running the statement. |
|
|
Specifies the username of the user performing the login or logout. |
|
|
Specifies the hostname or IP address that the client is using to connect to the cluster. |
|
|
Specifies the |
|
(Login attempts only) |
Specifies the authentication method for the user, for example, |
|
(Login attempts only) |
Indicates the success or failure of the login attempt.
|
|
|
Specifies the TLS encryption algorithm used during the session. |
|
|
Specifies the client application name retrieved from the session's |
|
|
Specifies the client OS user retrieved from the session's |
For example:
363750385,2026-08-11 18:53:18.150,UTC,c770dd909a9c:3306,agg,USER_LOGIN,100000,s2user,192.168.0.1,s2user@%,mysql_native_password,SUCCESS,ECDHE-RSA-AES256-GCM-SHA384,mysql,osuser
Completion Record Schema for Query Execution
Completion records capture the final outcome of a query after execution.id.
<id>,<record_type>,<completion_status:SUCCESS|FAILURE:error_code>,<records_affected>
|
Field |
Description |
|---|---|
|
|
Specifies the audit-log record ID of the original query record, used to correlate the command completion log to the original query. |
|
|
A record-type marker which indicates a query record. |
|
|
Specifies the final status of the query.
|
|
|
Specifies the number of affected or returned records recorded at completion time. |
For example:
123456,C,SUCCESS,42
Schema for ALL-RESULTS Database Responses
If your node is configured to use the ALL-RESULTS logging mode, the database’s responses are logged uniquely from other entries.SHOW VARIABLES LIKE '%master_ query:
237,R,master aggregator
The log entry above demonstrates the following schema:
<parent-query-log-entry-id>,R,<data>
Query results share the same entry ID as the query itself.<entry-id> value of 237.R denotes that the log entry only contains query result data.
General Log Entry Schema
All entries in a log file adhere to a predefined schema.UPDATE t SET a = 0 WHERE a = 1:
237,2016-08-25 11:29:09,PDT,localhost:3306,agg,1,99999,root,db,temp_1_14_16,9959767090931131257,UPDATE t SET a = 0 WHERE a = 1
The log entry above demonstrates the following schema:
<log-entry-id>,<timestamp>,<time-zone>,<hostname>:<port>,<node-type>,<aggregator-id>,<thread-id>,<username>,<database-name>,<correlation-id>,<query-hash>,<query>
Therefore, each of the 12 values can be mapped in the following way:
|
Example Value |
Definition |
|---|---|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
log-entry-id
The first value is log-entry-id, which represents the entry’s unique identifier within the scope of a single log file.0, incrementing by one afterwards.log-entry-id is a 64-bit unsigned integer value.
The entry ID for any given operation is unique to the node, regardless of how a query is processed across the cluster.
If your database is configured to use the ALL-RESULTS logging mode, the results will appear as additional log entries with the same <log-entry-id> as the parent.
timestamp
The second value is timestamp, which specifies the node’s local system time when an operation was executed.%Y-%m-%d %H:%M:%S. format.
time-zone
The third value is time-zone, which specifies the local time zone when an operation was executed.GMT (Greenwich Mean Time).
hostname:port
The fourth value is hostname:port, which specifies the node’s hostname and port.hostname global variable.
node-type
The fifth value is node-type, which specifies whether the node is an aggregator (agg) or a leaf (leaf).
aggregator-id
The sixth value is aggregator-id, which specifies the ID of the aggregator that issued any given query.aggregator-id is a 64-bit unsigned integer value.
An aggregator-id may contain an invalid value of 18446744073709551615 if the aggregator has not yet been given an ID.
In a cluster with multiple aggregators, the ID of the master aggregator never changes, but the ID of a child aggregator may change.
When correlating a master aggregator’s query with its resulting downstream leaf node queries, you can use the combination of an entry’s correlation-id and aggregator-id values as a unique identifier.correlation-id and aggregator-id as a key.
thread-id
The seventh value is thread-id, which specifies the ID of the node’s thread that is executing the query.thread-id is a 32-bit integer value.
username
The eight value is username, which specifies the username of the authenticated user who is executing the query.
database-name
The ninth value is database-name, which specifies the name of the database that is being queried.
This value may appear as [unknown] in a log entry under a few conditions:
-
If the query is not related to a specific database (e.
g. SHOW VARIABLES). -
If the user does not specify
USE <database-name>before executing their query.However, in this case the query does contain the database, such as SELECT * from <db-name>..t
correlation-id
The tenth value is correlation-id, which specifies an identifier for the current query.
When correlating a master aggregator’s query with its resulting downstream leaf node queries, you can use the combination of an entry’s correlation-id and aggregator-id values as a unique identifier.correlation-id and aggregator-id as a key.
Under some circumstances, a correlation-id value may not appear in the log entry.
query-hash
The 11th value is query-hash, which specifies a unique hash of either the query signature or the query text.query-hash is a 64-bit unsigned integer value.
The full query text will only be hashed if the node’s logging level is set to ALL-QUERIES-PLAINTEXT or ALL-QUERIES-PLAINTEXT-INCLUDING-PARSE-FAILS.
query
The 12th value is the query, which specifies either the query signature or the query text.
The full query text will only be written to the log if the node’s logging level is set to ALL-QUERIES-PLAINTEXT or ALL-QUERIES-PLAINTEXT-INCLUDING-PARSE-FAILS.
The USING clause of queries is not captured as part of audit logging and can be viewed via SHOW PROCESSLIST where applicable.
Last modified: