DSE監査テーブルからイベントを表示する

dse_audit.audit_logテーブルに捕捉されたイベントをCQLクエリーを使用して表示します。

dse_audit.audit_logテーブルには、CassandraAuditWriterロガーで監査が有効にされているすべてのノードのデータベース・アクティビティー・イベントが格納されます。CQLを使用してテーブルをクエリーし、結果を表示します。

重要: dse_auditキースペースのレプリケーション係数を、監査が有効になっているすべてのデータ・センターのうちの少なくとも1つに設定します。

audit_logのカラム

監査ログ・テーブルには、監査が有効になっているノードからのすべてのイベントが含まれます。DataStax Enterpriseは、イベントを以下の列に解析します。

ヒント: テーブルスキーマを表示するには、cqlshでDESC TABLE dse_audit.audit_logを使用します。テーブルには、複合パーティション・キー、日付、ノード、day_partition、および単一のクラスター化カラム・イベント時間があります。
1. audit_logのカラム
カラム タイプ 説明
date timestamp イベントの日付(パーティション・カラム1)
node inet DSEノードのIPアドレス。(パーティション・カラム2)
day_partition int 現在の時刻 * 3600(GMTを使用)。(パーティション・カラム3)
event_time timeuuid イベントの開始時に生成されたTIMEUUID。(クラスター化カラム)
authenticated text ログインに使用されるユーザー名またはID。
batch_id uuid Cassandraに書き込まれたときにイベントがグループ分けされたバッチ・クエリーのUUID
category text イベント・カテゴリー名:
consistency text 整合性レベルの要求。
keyspace_name text イベントが発生したキースペース名。
operation text イベントの説明とCQL要求(該当する場合)。
source text クライアントIPアドレス。
table_name text イベントが発生したテーブル名(該当する場合)。
type text イベントのタイプ各カテゴリーのタイプを参照してください。
username text ログインしているユーザーのDSEロール名。

監査クエリーの例

以下で発生した特定のノード上のすべてのイベントを取得します。
SELECT * FROM dse_audit.audit_log;
以下は、DSE Graphクエリーからのサンプル出力です。
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 57ff2dc0-3827-11e6-9ea9-2f93eec587f0 | null | QUERY | null | null | 
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 57ffa2f0-3827-11e6-9ea9-2f93eec587f0 | null |   DML |   null |        test |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 57ffca00-3827-11e6-9ea9-2f93eec587f0 | null | QUERY |    ONE |        test |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 58001820-3827-11e6-9ea9-2f93eec587f0 | null |   DML |   null |        test |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 58001821-3827-11e6-9ea9-2f93eec587f0 | null | QUERY |    ONE |        test |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 58008d50-3827-11e6-9ea9-2f93eec587f0 | null |   DML |   null |        test |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 5800db70-3827-11e6-9ea9-2f93eec587f0 | null |   DML |   null |        test |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 5800db71-3827-11e6-9ea9-2f93eec587f0 | null | QUERY |    ONE |        test |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 58012990-3827-11e6-9ea9-2f93eec587f0 | null |   DML |   null |        test |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 58019ec0-3827-11e6-9ea9-2f93eec587f0 | null |   DML |   null |        test |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 58019ec1-3827-11e6-9ea9-2f93eec587f0 | null | QUERY |    ONE |        test |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 5bb86530-3827-11e6-9ea9-2f93eec587f0 | null | QUERY |    ONE |   dse_audit |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 6dfac5d0-3827-11e6-9ea9-2f93eec587f0 | null | QUERY | QUORUM | test_system |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 6dfbb030-3827-11e6-9ea9-2f93eec587f0 | null |   DML |   null | test_system |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 6dfbb031-3827-11e6-9ea9-2f93eec587f0 | null | QUERY | QUORUM | test_system |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 70c70530-3827-11e6-9ea9-2f93eec587f0 | null |   DML |   null |  dse_system |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 70c70531-3827-11e6-9ea9-2f93eec587f0 | null | QUERY | QUORUM |  dse_system |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 78fb6480-3827-11e6-9ea9-2f93eec587f0 | null | QUERY |    ONE |   dse_audit |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 7aadcf70-3827-11e6-9ea9-2f93eec587f0 | null |   DML |   null | test_system |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 7aadf680-3827-11e6-9ea9-2f93eec587f0 | null | QUERY | QUORUM | test_system |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 7aaee0e0-3827-11e6-9ea9-2f93eec587f0 | null |   DML |   null | test_system |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 7aaee0e1-3827-11e6-9ea9-2f93eec587f0 | null | QUERY | QUORUM | test_system |
 2016-06-22 00:00:00+0000 | 127.0.0.1 | 10800 | 8195b190-3827-11e6-9ea9-2f93eec587f0 | null | QUERY |    ONE |   dse_audit |
RequestMessage{, requestId=941d2e1a-7cc9-4c80-8c28-dccb799840b7, op='eval', processor='session', args={gremlin=g.V().count(), 
  aliases={g=testQSagain.g}, session=d179c734-813f-4a3e-89d6-bd756b4fcf57, bindings={}, manageTransaction=true, batchSize=64}}         | /127.0.0.1:60647 |         null | GRAPH_TINKERPOP_TRAVERSAL |   unknown
 SELECT "community_id", "member_id" FROM "test"."meal_p" WHERE "~~vertex_exists" = ? LIMIT ? ALLOW FILTERING;                          |         /0.0.0.0 |       meal_p |     CQL_PREPARE_STATEMENT |    system
 Query string not found in prepared statement cache [bind variable values unavailable]                                                 |         /0.0.0.0 |       meal_p |                CQL_SELECT |    system
 SELECT "community_id", "member_id" FROM "test"."ingredient_p" WHERE "~~vertex_exists" = ? LIMIT ? ALLOW FILTERING;                    |         /0.0.0.0 | ingredient_p |     CQL_PREPARE_STATEMENT |    system
 Query string not found in prepared statement cache [bind variable values unavailable]                                                 |         /0.0.0.0 | ingredient_p |                CQL_SELECT |    system
 SELECT "community_id", "member_id" FROM "test"."author_p" WHERE "~~vertex_exists" = ? LIMIT ? ALLOW FILTERING;                        |         /0.0.0.0 |     author_p |     CQL_PREPARE_STATEMENT |    system
 Query string not found in prepared statement cache [bind variable values unavailable]                                                 |         /0.0.0.0 |     author_p |                CQL_SELECT |    system
 SELECT "community_id", "member_id" FROM "test"."book_p" WHERE "~~vertex_exists" = ? LIMIT ? ALLOW FILTERING;                          |         /0.0.0.0 |       book_p |     CQL_PREPARE_STATEMENT |    system
 Query string not found in prepared statement cache [bind variable values unavailable]                                                 |         /0.0.0.0 |       book_p |                CQL_SELECT |    system
 SELECT "community_id", "member_id" FROM "test"."recipe_p" WHERE "~~vertex_exists" = ? LIMIT ? ALLOW FILTERING;                        |         /0.0.0.0 |     recipe_p |     CQL_PREPARE_STATEMENT |    system
 Query string not found in prepared statement cache [bind variable values unavailable]                                                 |         /0.0.0.0 |     recipe_p |                CQL_SELECT |    system
 SELECT "community_id", "member_id" FROM "test"."reviewer_p" WHERE "~~vertex_exists" = ? LIMIT ? ALLOW FILTERING;                      |         /0.0.0.0 |   reviewer_p |     CQL_PREPARE_STATEMENT |    system
 Query string not found in prepared statement cache [bind variable values unavailable]                                                 |         /0.0.0.0 |   reviewer_p |                CQL_SELECT |    system
 select * from audit_log ;                                                                                                             |       /127.0.0.1 |    audit_log |                CQL_SELECT | anonymous
 SELECT last_updated FROM "test_system".shared_data WHERE dataspace = ?;                                                               |         /0.0.0.0 |  shared_data |     CQL_PREPARE_STATEMENT |    system
 Query string not found in prepared statement cache [bind variable values unavailable]                                                 |         /0.0.0.0 |  shared_data |                CQL_SELECT |    system
 SELECT last_updated FROM "test_system".shared_data WHERE dataspace = ?;                                                               |         /0.0.0.0 |  shared_data |     CQL_PREPARE_STATEMENT |    system
 Query string not found in prepared statement cache [bind variable values unavailable]                                                 |         /0.0.0.0 |  shared_data |                CQL_SELECT |    system
 SELECT last_updated FROM "dse_system".shared_data WHERE dataspace = ?;                                                                |         /0.0.0.0 |  shared_data |     CQL_PREPARE_STATEMENT |    system
 Query string not found in prepared statement cache [bind variable values unavailable]                                                 |         /0.0.0.0 |  shared_data |                CQL_SELECT |    system
 select * from audit_log ;                                                                                                             |       /127.0.0.1 |    audit_log |                CQL_SELECT | anonymous
 SELECT last_updated FROM "test_system".shared_data WHERE dataspace = ?;                                                               |         /0.0.0.0 |  shared_data |     CQL_PREPARE_STATEMENT |    system
 Query string not found in prepared statement cache [bind variable values unavailable]                                                 |         /0.0.0.0 |  shared_data |                CQL_SELECT |    system
 Query string not found in prepared statement cache [bind variable values unavailable]                                                 |         /0.0.0.0 |  shared_data |                CQL_SELECT |    system
 select * from audit_log ;                                                                                                             |       /127.0.0.1 |    audit_log |                CQL_SELECT | anonymous