> ## Documentation Index
> Fetch the complete documentation index at: https://private-7c7dfe99-parallel-read-in-order-multi-part.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

> Shows the history of ZooKeeper connections (including auxiliary ZooKeepers).

# system.zookeeper_connection_log

<Info>
  **Querying in ClickHouse Cloud**

  The 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](/reference/system-tables/overview#system-tables-in-clickhouse-cloud) for further details.
</Info>

<h2 id="description">
  Description
</h2>

The 'system.zookeeper\_connection\_log' table shows the history of ZooKeeper connections (including auxiliary ZooKeepers). Each row shows information about one event regarding connections.

The table doesn't contain events for disconnections caused by server shutdown.

It is safe to truncate or drop this table at any time.

<h2 id="columns">
  Columns
</h2>

* `hostname` ([LowCardinality(String)](/reference/data-types/lowcardinality)) — Hostname of the server which is connected to or disconnected from ZooKeeper.
* `clickhouse_version` ([LowCardinality(String)](/reference/data-types/lowcardinality)) — Version of the ClickHouse server that produced the row.
* `system_processor` ([LowCardinality(String)](/reference/data-types/lowcardinality)) — CPU architecture of the ClickHouse server that produced the row.
* `type` ([Enum8('Connected' = 0, 'Disconnected' = 1)](/reference/data-types/enum)) — The type of the event. Possible values: Connected, Disconnected.
* `event_date` ([Date](/reference/data-types/date)) — Date of the entry.
* `event_time` ([DateTime](/reference/data-types/datetime)) — Time of the entry
* `event_time_microseconds` ([DateTime64(6)](/reference/data-types/datetime64)) — Time of the entry with microseconds precision.
* `name` ([String](/reference/data-types/string)) — ZooKeeper cluster's name.
* `host` ([String](/reference/data-types/string)) — The hostname/IP of the ZooKeeper node that ClickHouse connected to or disconnected from.
* `port` ([UInt16](/reference/data-types/int-uint)) — The port of the ZooKeeper node that ClickHouse connected to or disconnected from.
* `index` ([UInt8](/reference/data-types/int-uint)) — The index of the ZooKeeper node that ClickHouse connected to or disconnected from. The index is from ZooKeeper config.
* `client_id` ([Int64](/reference/data-types/int-uint)) — Session id of the connection.
* `keeper_api_version` ([UInt8](/reference/data-types/int-uint)) — Keeper API version.
* `enabled_feature_flags` ([Array(Enum16('FILTERED\_LIST' = 0, 'MULTI\_READ' = 1, 'CHECK\_NOT\_EXISTS' = 2, 'CREATE\_IF\_NOT\_EXISTS' = 3, 'REMOVE\_RECURSIVE' = 4, 'MULTI\_WATCHES' = 5, 'CHECK\_STAT' = 6, 'PERSISTENT\_WATCHES' = 7, 'CREATE\_WITH\_STATS' = 8, 'TRY\_REMOVE' = 9, 'LIST\_WITH\_STAT\_AND\_DATA' = 10, 'GET\_CHILDREN\_RECURSIVE' = 11, 'CREATE\_TTL' = 12, 'CREATE\_CONTAINER' = 13, 'MAX\_REQUEST\_SIZE' = 14, 'LIST\_WITH\_OPTIONS' = 15))](/reference/data-types/array)) — Feature flags which are enabled. Only applicable to ClickHouse Keeper.
* `availability_zone` ([String](/reference/data-types/string)) — Availability zone
* `reason` ([LowCardinality(String)](/reference/data-types/lowcardinality)) — Reason for the connection or disconnection.

<h2 id="examples">
  Examples
</h2>

```sql theme={null}
SELECT * FROM system.zookeeper_connection_log;
```

```text theme={null}
    ┌─hostname─┬─type─────────┬─event_date─┬──────────event_time─┬────event_time_microseconds─┬─name───────────────┬─host─┬─port─┬─index─┬─client_id─┬─keeper_api_version─┬─enabled_feature_flags───────────────────────────────────────────────────────────────────────┬─availability_zone─┬─reason──────────────┐
 1. │ node     │ Connected    │ 2025-05-12 │ 2025-05-12 19:49:35 │ 2025-05-12 19:49:35.713067 │ zk_conn_log_test_4 │ zoo2 │ 2181 │     0 │        10 │                  0 │ ['FILTERED_LIST','MULTI_READ','CHECK_NOT_EXISTS','CREATE_IF_NOT_EXISTS','REMOVE_RECURSIVE'] │                   │ Initialization      │
 2. │ node     │ Connected    │ 2025-05-12 │ 2025-05-12 19:49:23 │ 2025-05-12 19:49:23.981570 │ default            │ zoo1 │ 2181 │     0 │         4 │                  0 │ ['FILTERED_LIST','MULTI_READ','CHECK_NOT_EXISTS','CREATE_IF_NOT_EXISTS','REMOVE_RECURSIVE'] │                   │ Initialization      │
 3. │ node     │ Connected    │ 2025-05-12 │ 2025-05-12 19:49:28 │ 2025-05-12 19:49:28.104021 │ default            │ zoo1 │ 2181 │     0 │         5 │                  0 │ ['FILTERED_LIST','MULTI_READ','CHECK_NOT_EXISTS','CREATE_IF_NOT_EXISTS','REMOVE_RECURSIVE'] │                   │ Initialization      │
 4. │ node     │ Connected    │ 2025-05-12 │ 2025-05-12 19:49:29 │ 2025-05-12 19:49:29.459251 │ zk_conn_log_test_2 │ zoo2 │ 2181 │     0 │         6 │                  0 │ ['FILTERED_LIST','MULTI_READ','CHECK_NOT_EXISTS','CREATE_IF_NOT_EXISTS','REMOVE_RECURSIVE'] │                   │ Initialization      │
 5. │ node     │ Connected    │ 2025-05-12 │ 2025-05-12 19:49:29 │ 2025-05-12 19:49:29.574312 │ zk_conn_log_test_3 │ zoo3 │ 2181 │     0 │         7 │                  0 │ ['FILTERED_LIST','MULTI_READ','CHECK_NOT_EXISTS','CREATE_IF_NOT_EXISTS','REMOVE_RECURSIVE'] │                   │ Initialization      │
 6. │ node     │ Disconnected │ 2025-05-12 │ 2025-05-12 19:49:29 │ 2025-05-12 19:49:29.909890 │ default            │ zoo1 │ 2181 │     0 │         5 │                  0 │ ['FILTERED_LIST','MULTI_READ','CHECK_NOT_EXISTS','CREATE_IF_NOT_EXISTS','REMOVE_RECURSIVE'] │                   │ Config changed      │
 7. │ node     │ Connected    │ 2025-05-12 │ 2025-05-12 19:49:29 │ 2025-05-12 19:49:29.909895 │ default            │ zoo2 │ 2181 │     0 │         8 │                  0 │ ['FILTERED_LIST','MULTI_READ','CHECK_NOT_EXISTS','CREATE_IF_NOT_EXISTS','REMOVE_RECURSIVE'] │                   │ Config changed      │
 8. │ node     │ Disconnected │ 2025-05-12 │ 2025-05-12 19:49:29 │ 2025-05-12 19:49:29.912010 │ zk_conn_log_test_2 │ zoo2 │ 2181 │     0 │         6 │                  0 │ ['FILTERED_LIST','MULTI_READ','CHECK_NOT_EXISTS','CREATE_IF_NOT_EXISTS','REMOVE_RECURSIVE'] │                   │ Config changed      │
 9. │ node     │ Connected    │ 2025-05-12 │ 2025-05-12 19:49:29 │ 2025-05-12 19:49:29.912014 │ zk_conn_log_test_2 │ zoo3 │ 2181 │     0 │         9 │                  0 │ ['FILTERED_LIST','MULTI_READ','CHECK_NOT_EXISTS','CREATE_IF_NOT_EXISTS','REMOVE_RECURSIVE'] │                   │ Config changed      │
10. │ node     │ Disconnected │ 2025-05-12 │ 2025-05-12 19:49:29 │ 2025-05-12 19:49:29.912061 │ zk_conn_log_test_3 │ zoo3 │ 2181 │     0 │         7 │                  0 │ ['FILTERED_LIST','MULTI_READ','CHECK_NOT_EXISTS','CREATE_IF_NOT_EXISTS','REMOVE_RECURSIVE'] │                   │ Removed from config │
    └──────────┴──────────────┴────────────┴─────────────────────┴────────────────────────────┴────────────────────┴──────┴──────┴───────┴───────────┴────────────────────┴─────────────────────────────────────────────────────────────────────────────────────────────┴───────────────────┴─────────────────────┘
```
