View events from HCD audit table

The hcd_audit.audit_log table stores database activity events for all nodes that have auditing enabled with the CassandraAuditWriter logger. Use CQL to query the table and view results.

Set the replication factor for the hcd_audit keyspace to at least one in all datacenters where auditing is enabled.

audit_log columns

The audit log table contains all events from nodes that have auditing enabled. HCD parses the events into the following columns.

In cqlsh, use DESC TABLE hcd_audit.audit_log to view table schema. The table has a compound partition key, date, node, day_partition, and a single clustering column event time.

Audit log columns
Column Type Description

date

timestamp

Date of the event. (Partition column 1)

node

inet

HCD node IP address. (Partition column 2)

day_partition

int

Current hour of the day * 3600, using GMT. (Partition column 3)

event_time

timeuuid

A TIMEUUID generated when the event began. (Clustering column)

authenticated

text

User name or id used to login.

batch_id

uuid

The UUID of the batch query the event was grouped with when written to Cassandra.

category

text

The event category name:

consistency

text

Request consistency level.

keyspace_name

text

Keyspace name where the event occurred.

operation

text

Event description and CQL request if applicable.

source

text

Client IP address.

table_name

text

Table name where the event occurred if applicable.

type

text

The type of the event. See types in each category.

username

text

HCD role name of the logged in user.

Example Output

The following is an example of audit log output:

date                | node           | day_partition | event_time | authenticated | batch_id | category | consistency | keyspace_name | operation | source | table_name | type | username
2023-01-01 12:00:00 | 127.0.0.1     | 43200         | uuid-1     | admin         | uuid-2   | QUERY    | ONE         | test          | SELECT * FROM users | 127.0.0.1 | users | CQL_SELECT | admin

Was this helpful?

Give Feedback

How can we improve the documentation?

© 2025 DataStax, an IBM Company | Privacy policy | Terms of use | Manage Privacy Choices

Apache, Apache Cassandra, Cassandra, Apache Tomcat, Tomcat, Apache Lucene, Apache Solr, Apache Hadoop, Hadoop, Apache Pulsar, Pulsar, Apache Spark, Spark, Apache TinkerPop, TinkerPop, Apache Kafka and Kafka are either registered trademarks or trademarks of the Apache Software Foundation or its subsidiaries in Canada, the United States and/or other countries. Kubernetes is the registered trademark of the Linux Foundation.

General Inquiries: +1 (650) 389-6000, info@datastax.com