# 監査ログのエクスポート

この文書は、監査関連クエリの作成およびその後のサードパーティのインテグレーションによる監査ログ結果のエクスポートに必要なすべての監査トレイルコードを一覧にしています。

## Infinityでの監査ログのクエリ <a href="#audittrailcodes-usingaudittrailcodesininfinitynqlqueries" id="audittrailcodes-usingaudittrailcodesininfinitynqlqueries"></a>

{% hint style="warning" %}
このセクションの手順とNQLクエリはNexthink Infinityに適用されます。

[監査ログAPI (クラシック)](https://docs.nexthink.com/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/api-and-integrations-classic/audit-trail-api-classic) のドキュメントは、エクスポートされた監査ログのときにExperienceイベント（エンジン、ファインダー）を追跡する必要がある場合にのみ参照してください。
{% endhint %}

監査ログをクエリするには、以下の手順に従います：

1. [NQLデータモデル](https://docs.nexthink.com/platform/ja/understanding-key-data-platform-concepts/nql-data-model)ドキュメントにアクセスして、監査ログテーブルの必要なフィールドを特定します。
2. Nexthink のユーザーまたはシステムの操作を監査するために必要な [audit trail codes](https://docs.nexthink.com/platform/ja/security/exporting-audit-logs/audit-trail-codes) を特定します。
3. Nexthink Infinityのクエリベースの機能のいずれかでNQLクエリを実行します。

[Audit trail codes Infinity](https://docs.nexthink.com/platform/ja/security/exporting-audit-logs/audit-trail-codes)のドキュメントを参照して、Nexthink Infinityに適用される監査トレイルコードを確認してください。

### 監査トレイルコードを使用したNQLクエリの例

以下のNQLクエリの例は、`platform.audit_logs`フィールドと`94011`監査トレイルコードを使用して、NexthinkユーザーがUIで行った**リモートアクションの手動実行**を取得します。

{% code title="Code" overflow="wrap" lineNumbers="true" %}

```
platform.audit_logs during past 30d
| where code == 94011
```

{% endcode %}

調査の[NQL editor](https://docs.nexthink.com/platform/ja/user-guide/investigations/creating-investigations/nql-editor)でNQLクエリの例を実行すると、調査結果は**Message**列に次の情報を報告します：

* `Web request manual execution of remote action`
* `source= source where remote action is triggered`
* `ID=remote action uid`
* `name=remote action on n devices with uids devices uids`

以下の画像では、Nexthink webインターフェースの**Message**列に結果が表示されています。

{% hint style="info" %}
[ロール](https://github.com/nexthink/documentation.online-product-documentation/blob/develop/ja/configuring_nexthink/configuring-your-platform/administration/account-management/roles/README.md)のドキュメントを参照して、監査ログの問い合わせに必要な **NQLでの監査ログのビュー** 権限を付与してください。
{% endhint %}

<figure><img src="https://3549141153-files.gitbook.io/~/files/v0/b/gitbook-x-prod.appspot.com/o/spaces%2FeLm8O7QKZDn6z806e7Sv%2Fuploads%2Fgit-blob-995fb24e293a10e46dddb2906caa31b621c592d4%2Faudittrailscodeapplication-1716897403.png?alt=media" alt="Running Audit logs table and codes in the NQL Editor." width="760"><figcaption></figcaption></figure>

## サードパーティインテグレーションによる監査ログのエクスポート <a href="#audittrailcodes-exportingauditlogsbythird-partyintegrations" id="audittrailcodes-exportingauditlogsbythird-partyintegrations"></a>

監査ログをサードパーティシステムにエクスポートするには、以下のインテグレーションオプションがあります：

* [Azure Data Lake用データエクスポーター](https://docs.nexthink.com/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/outbound-connectors/data-exporters/exporter-for-azure-data-lake) - 推奨オプション
  * リクエストごとに最大100万のレコードを処理します。
* [NQL APIエクスポート](https://docs.nexthink.com/api/nql)
  * リクエストごとに最大100万のレコードを処理します。
  * 1日あたり24以上のAPIコールを消費しないようにして、システムが1日の最大リクエスト数50を超えるのを防ぎます。
* [ウェブフック](https://docs.nexthink.com/platform/ja/configuring_nexthink/bringing-data-into-your-nexthink-instance/integrating-nexthink-with-third-party-tools/outbound-connectors/webhooks)

監査ログは、ワークフローのイベントトリガーとしても利用可能です。詳細は[#triggeringworkflows-triggeringaneventworkflow](https://docs.nexthink.com/platform/ja/user-guide/workflows/triggering-workflows#triggeringworkflows-triggeringaneventworkflow "mention")のドキュメントを参照してください。

{% hint style="info" %}
Nexthink Infinityに適用される監査トレイルコードについては、[Audit trail codes Infinity](https://docs.nexthink.com/platform/ja/security/exporting-audit-logs/audit-trail-codes)ドキュメントを参照してください。

場合によっては、[監査トレイルコードEngine（クラシック）](https://docs.nexthink.com/platform/ja/security/exporting-audit-logs/audit-trail-codes-engine-classic)および[監査トレイルコードPortal（クラシック）](https://docs.nexthink.com/platform/ja/security/exporting-audit-logs/audit-trail-codes-portal-classic)に特化したドキュメントを参照してください。
{% endhint %}
