Skip to main content
Querying in ClickHouse CloudThe data in this system table is held locally on each node in ClickHouse Cloud. Obtaining a complete view of all data, therefore, requires the clusterAllReplicas function. See here for further details.

Description

Contains information about all successful and failed login and logout events. Availability system.session_log is created only when the server configuration contains a session_log section. The section is commented out in the default configuration, so queries against the table fail with UNKNOWN_TABLE until it is enabled. For example:

Reading rotated tables after an upgrade

When a new value is added to the interface enumeration, the table already stored on disk keeps the older Enum8 definition. On the first start of the new version, system.session_log is renamed to system.session_log_<N> and a fresh table with the current schema is created in its place; the schema of the rotated table is not changed. If a login was recorded over an interface that was missing from the enumeration of the version that wrote it — for example an ArrowFlight login on a version where ArrowFlight was absent from the interface enumeration — the rotated table contains a raw value that its own enumeration does not define, and a SELECT from it throws Unexpected value 10 in enum. Extend the enumeration of that table to read it; this is a metadata-only operation which does not rewrite any data:
It is safe to truncate or drop this table at any time.

Columns

Example

Query
Response
Last modified on September 11, 2026