Audit log file v14
You can generate the audit log file in CSV or XML format. The format is determined by the
edb_audit configuration parameter.
The information in the audit log is based on the logging performed by PostgreSQL, as described in "Using CSV-Format Log Output” under “Error Reporting and Logging” in the PostgreSQL core documentation.
The following table lists the fields in the order they appear in the CSV audit log format. The table contains the following information:
- Field. Name of the field as shown in the sample table definition in the PostgreSQL documentation.
- XML element/attribute. For the XML format, name of the XML element and its attribute (if used), referencing the value.
- Data type. Data type of the field as given by the PostgreSQL sample table definition.
- Description. Description of the field.
The fields that don't have any values for logging appear as consecutive commas (,,) in the CSV format.
|Field||XML element/attribute||Data type||Description|
|Log date/time of the statement.|
|Database user who executed the statement.|
|Database in which the statement was executed.|
|Operating system process ID in which the statement was executed.|
|Host and port location from where the statement was executed.|
|Session ID in which the statement was executed.|
|Order of the statement within the session.|
|Date/time when the session was started.|
|Virtual transaction ID of the statement.|
|Regular transaction ID of the statement.|
|Statement severity. Values are |
|SQL state code returned for the statement. The |
|The SQL statement that was attempted for execution.|
|Error message detail.|
|Hint for error.|
|Internal query that led to the error, if any.|
|Character count of the error position therein.|
|User query that led to the error. For errors only.|
|Character count of the error position therein. For errors only.|
|Location of the error in the source code. The location field is populated if |
|Name of the application from which the statement was executed, for example, |
|See note at bottom of the page||Process ID of leader for active parallel workers.|
|See note at bottom of the page||Identifier of this backend's most recent query.|
|SQL command of the statement.|
|Value specified by the |
|Determines the audit |
The following examples are generated in the CSV and XML formats.
The non-default audit settings in the
postgresql.conf file are as follows:
edb_audit parameter is changed to
xml when generating the XML format.
The following is the audited session:
CSV audit log file
The following is the CSV format of the audit log file. (Each audit log entry was split and displays across multiple lines. A blank line was inserted between the audit log entries for visual clarity.)
XML audit log file
The following is the XML format of the audit log file. (The output was formatted for visual clarity.)
The XML audit log file currently doesn't capture the
leader PID and
query ID fields. The fields will be added to the XML file in a future minor release.
- On this page
- CSV audit log file
- XML audit log file