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

> 成功および失敗したすべての ログイン・ログアウトイベントに関する情報を含むシステムテーブル。

# system.session_log

<Info>
  **ClickHouse Cloud でのクエリ**

  このシステムテーブルのデータは、ClickHouse Cloud の各ノードにローカルに保持されています。したがって、すべてのデータを完全に把握するには、`clusterAllReplicas` 関数を使用する必要があります。詳細については、[こちら](/ja/reference/system-tables/overview#system-tables-in-clickhouse-cloud)を参照してください。
</Info>

<div id="description">
  ## 説明
</div>

成功・失敗したログイン・ログアウトイベントに関する情報が含まれています。

<div id="columns">
  ## カラム
</div>

* `hostname` ([LowCardinality(String)](/ja/reference/data-types/lowcardinality)) — クエリを実行するサーバーのホスト名。
* `type` ([Enum8('LoginFailure' = 0, 'LoginSuccess' = 1, 'Logout' = 2)](/ja/reference/data-types/enum)) — ログイン/ログアウトの結果。設定可能な値: LoginFailure — ログインエラー。LoginSuccess — ログイン成功。Logout — システムからのログアウト。
* `auth_id` ([UUID](/ja/reference/data-types/uuid)) — 認証 ID。ユーザーがログインするたびに自動生成される UUID です。
* `session_id` ([String](/ja/reference/data-types/string)) — クライアントが HTTP インターフェイス経由で渡すセッション ID。
* `event_date` ([Date](/ja/reference/data-types/date)) — ログイン/ログアウトの日付。
* `event_time` ([DateTime](/ja/reference/data-types/datetime)) — ログイン/ログアウトの時刻。
* `event_time_microseconds` ([DateTime64(6)](/ja/reference/data-types/datetime64)) — マイクロ秒精度を含むログイン/ログアウト開始時刻。
* `user` ([Nullable(String)](/ja/reference/data-types/nullable)) — ユーザー名。
* `auth_type` ([Nullable(Enum8('NO\_PASSWORD' = 0, 'PLAINTEXT\_PASSWORD' = 1, 'SHA256\_PASSWORD' = 2, 'DOUBLE\_SHA1\_PASSWORD' = 3, 'LDAP' = 4, 'KERBEROS' = 5, 'SSL\_CERTIFICATE' = 6, 'BCRYPT\_PASSWORD' = 7, 'SSH\_KEY' = 8, 'HTTP' = 9, 'JWT' = 10, 'SCRAM\_SHA256\_PASSWORD' = 11, 'NO\_AUTHENTICATION' = 12))](/ja/reference/data-types/nullable)) — 認証の種類。
* `profiles` ([Array(LowCardinality(String))](/ja/reference/data-types/array)) — すべてのロールおよび/またはユーザーに設定されたプロファイルの一覧。
* `roles` ([Array(LowCardinality(String))](/ja/reference/data-types/array)) — プロファイルが適用されるロールの一覧。
* `settings` ([Array(Tuple(LowCardinality(String), String))](/ja/reference/data-types/array)) — クライアントのログイン/ログアウト時に変更された設定。
* `client_address` ([IPv6](/ja/reference/data-types/ipv6)) — ログイン/ログアウトに使用された IP アドレス。
* `client_port` ([UInt16](/ja/reference/data-types/int-uint)) — ログイン/ログアウトに使用されたクライアントポート。
* `interface` ([Enum8('TCP' = 1, 'HTTP' = 2, 'gRPC' = 3, 'MySQL' = 4, 'PostgreSQL' = 5, 'Local' = 6, 'TCP\_Interserver' = 7, 'Prometheus' = 8, 'Background' = 9)](/ja/reference/data-types/enum)) — ログイン元のインターフェイス。
* `client_hostname` ([String](/ja/reference/data-types/string)) — clickhouse-client または他の TCP クライアントが実行されているクライアントマシンのホスト名。
* `client_name` ([String](/ja/reference/data-types/string)) — clickhouse-client または他の TCP クライアントの名前。
* `client_revision` ([UInt32](/ja/reference/data-types/int-uint)) — clickhouse-client または他の TCP クライアントのリビジョン。
* `client_version_major` ([UInt32](/ja/reference/data-types/int-uint)) — clickhouse-client または他の TCP クライアントのメジャーバージョン。
* `client_version_minor` ([UInt32](/ja/reference/data-types/int-uint)) — clickhouse-client または他の TCP クライアントのマイナーバージョン。
* `client_version_patch` ([UInt32](/ja/reference/data-types/int-uint)) — clickhouse-client または他の TCP クライアントのバージョンのパッチ部分。
* `failure_reason` ([String](/ja/reference/data-types/string)) — ログイン/ログアウト失敗の理由を示す例外メッセージ。

<div id="example">
  ## 例
</div>

```sql title="Query" theme={null}
SELECT * FROM system.session_log LIMIT 1 FORMAT Vertical;
```

```text title="Response" theme={null}
Row 1:
──────
hostname:                clickhouse.eu-central1.internal
type:                    LoginSuccess
auth_id:                 45e6bd83-b4aa-4a23-85e6-bd83b4aa1a23
session_id:
event_date:              2021-10-14
event_time:              2021-10-14 20:33:52
event_time_microseconds: 2021-10-14 20:33:52.104247
user:                    default
auth_type:               PLAINTEXT_PASSWORD
profiles:                ['default']
roles:                   []
settings:                [('load_balancing','random'),('max_memory_usage','10000000000')]
client_address:          ::ffff:127.0.0.1
client_port:             38490
interface:               TCP
client_hostname:
client_name:             ClickHouse client
client_revision:         54449
client_version_major:    21
client_version_minor:    10
client_version_patch:    0
failure_reason:
```
