> For the complete documentation index, see [llms.txt](https://docs.nexthink.com/platform/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/administration/content-management/custom-trends-management/custom-trends-nql-examples.md).

# カスタムトレンド NQLの例

## 実行クラッシュを追跡する

実行クラッシュの毎日の数を追跡します。

**カスタムトレンドの定義**

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

```
デバイス
| 実行クラッシュを含める 1日前
| nb_crashes = number_of_crashes.sum() を計算する
| nb_crashes, hardware.manufacturer をリストする
```

{% endcode %}

**カスタムトレンドデータの取得**

上記のトレンド定義を使用して、次のダッシュボードを作成できます。

<figure><img src="/files/E6ZYEmn66n2XvtbWcU4J" alt=""><figcaption></figcaption></figure>

1. クラッシュのあるデバイスの数とデバイスの総数を計算します。

   <pre data-overflow="wrap" data-line-numbers><code>カスタムトレンド.#execution_crashes.snapshots 過去90日間
   | devices_with_crashes = device.countif(nb_crashes > 0), device_count = device.count()
    として集計する
   </code></pre>
2. 過去90日間のクラッシュの総数の日次変化を観察します。

   <pre data-overflow="wrap" data-line-numbers><code>カスタムトレンド.#execution_crashes.snapshots 過去90日間
   | number_of_crashes_ = nb_crashes.sum() by 1日 として集計する
   </code></pre>
3. デバイスプラットフォームごとのクラッシュの総数を観察します。 少なくとも1回のクラッシュがあるデバイスのみを含めます。

   <pre data-overflow="wrap" data-line-numbers><code>カスタムトレンド.#execution_crashes.snapshots 過去90日間
   | nb_crashes > 0 のデバイスを含める
   | number_of_crashes_ = nb_crashes.sum() by context.device_platform として集計する
   | number_of_crashes_ 降順に並び替え
   </code></pre>
4. デバイスハードウェアメーカーごとのクラッシュの総数とクラッシュのあるデバイス数を観察します。

   <pre data-overflow="wrap" data-line-numbers><code>カスタムトレンド.#execution_crashes.snapshots 過去90日間
   | hardware_manufacturer != "VMWare" のデバイスを除外
   | hardware_manufacturer != null のデバイスを除外
   | number_of_crashes_ = nb_crashes.sum(), number_of_devices_ = device.count() by hardware_manufacturer として集計する
   | number_of_crashes_ 降順に並び替え
   </code></pre>

## Windows 11移行の監視

時間の経過に伴うWindows 11を搭載したデバイスの比率を追跡します。

**カスタムトレンドの定義**

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

```
デバイス
| operating_system.platform == windows を含める
| operating_system.name, hardware.type をリストする
```

{% endcode %}

**カスタムトレンドデータの取得**

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

```
カスタムトレンド.#windows_migration.snapshots 過去300日間
| hardware_type !in [virtual, null] のデバイスを除外
| ratio_with_windows_11 = countif(operating_system_name == "*windows 11*")/count() by 1日 として集計する
```

{% endcode %}

## ブート時間の監視

各デバイスの平均ブート時間を追跡し、詳細な設定の効果を監視します。

**カスタムトレンドの定義**

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

```
デバイス 過去1日
| device_performance.boots 過去1日を含める
| boot_duration = duration.avg() として計算する
| boot_duration, hardware.type をリストする
```

{% endcode %}

**カスタムトレンドデータの取得**

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

```
custom_trend.#boot_duration.snapshots 過去90日間
| (context.device_platform == "Windows" and hardware_type == laptop) のデバイスを含める
| boot_duration_avg = boot_duration.avg() by 1日 として集計する
```

{% endcode %}

## アプリケーション起動時のクラッシュがあるデバイスを監視する

アプリケーション起動時に少なくとも1つのアプリケーションクラッシュが発生したデバイスの日次数を追跡します。

**カスタムトレンドの定義**

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

```
デバイス 過去1日
| 実行クラッシュ 過去1日を含める
| crash_on_start == true のデバイスを含める
| crash_on_start_count = count() として計算する
| crash_on_start_count をリストする
```

{% endcode %}

**カスタムトレンドデータの取得**

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

```
custom_trend.#crashes_on_start.snapshots 過去300日間
| crash_on_start_count > 0 のデバイスを含める
| devices_with_app_crashes_at_start = count() by 1日 として集計する
```

{% endcode %}

## 異なるバージョンのバイナリによるCPU使用率の監視

アプリケーションの各バージョンごとの平均CPU使用率を追跡します。

**カスタムトレンドの定義**

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

```
デバイス
| 実行イベント 過去1日を含める
| binary.name == "zoom.exe" のデバイスを含める
| CPU_usage_ratio = ((cpu_time.sum()) * (100)) / ((execution_duration.sum()) * (number_of_logical_processors.max())), last_version = binary.version.last() として計算する
| CPU_usage_ratio, last_version をリストする
```

{% endcode %}

**カスタムトレンドデータの取得**

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

```
custom_trend.#zoom_cpu_usage_ratio.snapshots 過去300日間
| c1 = CPU_usage_ratio.avg() by 1日, last_version として集計する
```

{% endcode %}


---

# 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 dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.nexthink.com/platform/ja/user-guide/administration/content-management/custom-trends-management/custom-trends-nql-examples.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
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.
