> For the complete documentation index, see [llms.txt](https://docs.nexthink.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.nexthink.com/platform/ja/user-guide/spark/spark-nql-capabilities.md).

# Spark NQL の機能

[Investigations](/platform/ja/user-guide/investigations/creating-investigations/nql-editor.md) モジュールで Nexthink Query Language（NQL）を使用して、Spark conversations データにアクセスします。

システムは各会話を `agent.conversations` NQL テーブルに保存します。利用可能なフィールドの詳細については、[NQL データモデル > Namespace agent](/platform/ja/understanding-key-data-platform-concepts/nql-data-model.md#agent) を参照してください。

以下は一般的な NQL クエリの例です。

<details>

<summary>主要な Spark KPI</summary>

過去 30 日間の主要な Spark KPI（アクティブユーザー数、会話の総数、現在アクティブな会話数など）を取得します。

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

```
agent.conversations during past 30d
| summarize active_users = user.count(), total_conversations = conversation_id.count(), active_conversations = conversation_id.countif((state == in_progress or state == null))
```

{% endcode %}

</details>

<details>

<summary>デバイスごとの会話数と会話時間</summary>

デバイスごとの会話数と平均会話時間を取得します。

```
devices during past 30d
| include agent.conversations during past 30d
| where agent.conversations.outcome in [resolved, escalated]
| compute number_of_conversations_ = conversations.number_of_conversations.sum(), average_resolution_time = agent.conversations.conversation_duration.avg()
| where number_of_conversations_ != 0
| where average_resolution_time != 0
| list device.name, device.entity, device.hardware.model, device.hardware.type, device.operating_system.name, number_of_conversations_, average_resolution_time
| sort number_of_conversations_ desc
```

</details>

<details>

<summary>解決理由別の解決済み会話数</summary>

過去 7 日間の解決理由別の解決済み会話数を取得します。

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

```
agent.conversations during past 7d
| where outcome == resolved
| summarize number_of_conversations_by_reason = count() by reason
```

{% endcode %}

</details>

関連トピック

* [Spark のモニタリング](/platform/ja/user-guide/spark/working-with-spark/monitoring-spark.md)
* [NQLデータモデル](/platform/ja/understanding-key-data-platform-concepts/nql-data-model.md#agent)


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

## Querying This Documentation
If you need additional information that is not directly available in this page, you can query the documentation by asking a question.

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.nexthink.com/platform/ja/user-guide/spark/spark-nql-capabilities.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
