# 調査のNQLサンプル

このクエリ例のリストは、Nexthinkのウェブインターフェースで効果的な調査を行うために設計されています。 以下に示す調査を確認し、ご自身が行おうとしている調査に最も似ているものを選んでください。 クエリをコピーし、ご自身のユースケースに合わせて調整してください。

## デバイス テーブルを照会する <a href="#investigationsnqlexamples-querydevicetables" id="investigationsnqlexamples-querydevicetables"></a>

<details>

<summary>過去7日間における、すべてのデバイスでのOutlookの総受信トラフィックを取得します。</summary>

```
デバイス
| 実行イベントを過去7日間に含める
| binary.name == "outlook.exe"に基づき絞り込み
| total_incoming_traffic = incoming_traffic.sum() を計算
| デバイス名、デバイスエンティティ、total_incoming_trafficをリスト
```

</details>

<details>

<summary>過去1時間に頻繁なシステムクラッシュがあったかを確認します。例えば、過去24時間で2%以上のデバイスがクラッシュした場合</summary>

```
過去24時間のデバイス
| device_performance.system_crashesを含める
| system_crash_count= number_of_system_crashes.sum()、crashing_devices= device.count() を計算
| ratio_of_devices_crashing= crashing_devices.sum() * 100 / count() 、total_system_crashes= system_crash_count.sum()を要約
```

</details>

<details>

<summary>メモリアップグレードが必要な全てのデバイスをリストします。</summary>

```
過去7日間のデバイス
| 過去7日間のdevice_performanceイベントを含める
| used_memory_= event.used_memory.avg()、used_memory_percentage= event.used_memory.avg()*100/device.hardware.memory.avg()を計算
| used_memory_percentage> 75を基準に絞り込み
| デバイス名、デバイスエンティティ、デバイスモデル、デバイスタイプ、OS名、ハードウェアメモリ、used_memory_、used_memory_percentageをリスト
```

</details>

<details>

<summary>メモリアップグレードが必要なデバイスの数を計算し、ハードウェアメーカーごとにデバイスを分類します。</summary>

```
過去7日間のデバイス
| 過去7日間のdevice_performance.eventsを含む
| used_memory_ = event.used_memory.avg() ,  used_memory_percentage = event.used_memory.avg() * 100 / device.hardware.memory.avg() を計算する
| used_memory_percentage > 75 を含む
| hardware.manufacturer で c1 = count() を要約する
```

</details>

<details>

<summary>ディスク空き容量の少ないデバイスのリスト。</summary>

```
デバイス
| device_performance.eventsを過去124時間に含める
| free_space_on_system_drive = system_drive_free_space.avg()を計算
| free_space_on_system_drive < 2000MBを基準に絞り込み
```

</details>

<details>

<summary>デバイスを取得します。</summary>

Nexthink Collectorパッケージがインストールされているすべてのデバイスをリストします。

```
デバイス
| package.installed_packagesと共に
| package.name == "Nexthink Collector" の場合
```

</details>

<details>

<summary>デバイスを取得する。</summary>

Nexthink Collectorパッケージがインストールされていないすべてのデバイスを一覧表示します。

```
デバイス
| package.installed_packagesを含む
| package.name == "Nexthink Collector" の場合
| number_of_package_installed = count() を計算する
| number_of_package_installed == 0 の場合
```

</details>

### 他のテーブルを照会する <a href="#investigationsnqlexamples-queryothertables" id="investigationsnqlexamples-queryothertables"></a>

<details>

<summary>インストール イベントを取得します。</summary>

すべてのデバイスにわたる特定のパッケージのアンインストールを一覧表示します。

```
package.uninstallations
| package.name == "Nexthink Collector" の場合
| time, device.name, package.name, package.version をリストします
```

</details>

<details>

<summary>パッケージを取得します。</summary>

最も多くのデバイスにインストールされているものから始めてすべてのパッケージを一覧表示します。

```
package.installed_packages
| package.nameで number_of_packages_installed = count() を要約する
| number_of_packages_installedを降順にソートする
```

</details>

<details>

<summary>パッケージを取得します。</summary>

最も少ないデバイスにインストールされているものから始めてすべてのパッケージを一覧表示します。

```
package.installed_packages
| package.nameで number_of_packages_installed = count() を要約する
| number_of_packages_installedを昇順にソートする
```

</details>

<details>

<summary>パッケージを取得します。</summary>

少なくとも1台のデバイスにインストールされているが、5台未満のデバイスにインストールされているパッケージを一覧表示します。

```
package.installed_packages
| package.nameで number_of_packages_installed = count() を要約する
| number_of_packages_installed > 0 および number_of_packages_installed < 5 の場合
```

</details>

<details>

<summary>クラッシュごとにエラー ラベルでグループ化されたシステム クラッシュの数を一覧表示します。</summary>

```
過去7日間のdevice_performance.system_crashes
| labelで number_of_crashes = number_of_system_crashes.sum() を要約する
| number_of_crashesを降順にソートする
```

</details>

<details>

<summary>過去7日間のアクティブ デバイスの数をカウントします。</summary>

```
過去7日間のdevice_performance.events
| 1dでnb_devices = device.count() を要約する
| start_timeを昇順にソートする
```

</details>

<details>

<summary>ディスク空き容量の少ないデバイス数の履歴 (14 日間) を取得します。</summary>

```
過去14日間のdevice_performance.events
| system_drive_free_space.avg <= 1000MB の場合
| 1 日あたり声明されるデバイス数を要約します
```

</details>

<details>

<summary>バイナリごとのクラッシュ統計を取得します。</summary>

```
過去7日間のexecution.crashes
| binary.name, binary.product_name, binary.platformでcrashes = count(), devices_with_crashes = device.count(), versions_with_crashes = binary.version.count() を要約する
| devices_with_crashesを降順にソートする
```

</details>

<details>

<summary>選択されたバイナリのタイムライン上のクラッシュ統計を取得します。</summary>

```
過去7日間のexecution.crashes
| binary.name = "zscaler"
| foreground_crashes = countif(process_visibility == foreground), background_crashes = countif(process_visibility == background), devices_with_crashes = device.count(), versions_with_crashes = binary.version.count() を 1 日単位で要約します
```

</details>

<details>

<summary>部門ごとのユーザー 1 日あたりのアプリケーションの平均使用時間を計算します。</summary>

```
過去7日間のweb.events
| application.name == "Salesforce Lightning" の場合
| average_department_usage_time_per_user = duration.sum()/ user.name.count() を ad.departmentによって要約する
| average_department_usage_time_per_userを降順でソートします
```

</details>

<details>

<summary>キャンペーンの進捗を把握するために、キャンペーンおよび州ごとにキャンペーンの応答数をカウントします。</summary>

```
campaign.responses
| campaign.name != null の場合
| campaign.name, state, state_detailsでnumber_of_responses = count()を要約する
| campaign.nameを昇順でソートします
```

</details>

<details>

<summary>過去7日間のバイナリを取得します。</summary>

カテゴリとサブカテゴリごとに要約します。

```
過去7日間のbinaries
| product_category != null の場合
| product_category, product_subcategoryでnr_binaries = count()を要約する
| product_categoryを昇順でソートします
```

</details>

<details>

<summary>過去7日間のバイナリを取得します。</summary>

アクセシビリティのカテゴリとビジョンアクセシビリティのサブカテゴリに従って要約します。

```
過去7日間のbinary.binaries
| binary.product_category != null の場合
| (binary.product_category == "Accessibility" and binary.product_subcategory == "Vision Accessibility") の場合
| binary.name, binary.product_name, binary.version, binary.product_category, binary.product_subcategoryをリストします
```

</details>

<details>

<summary>過去7日間のユーザーを取得します。</summary>

開発ツールのカテゴリおよびコードエディタとIDEのサブカテゴリの下のバイナリについて、使用時間が30 分以上であるユーザーを一覧表示します。

```
過去7日間のユーザー
| 過去7日間のexecution.eventsを含む
| binary.product_category == "Development Tools" および binary.product_subcategory == "Code Editors and IDEs" の場合
| usage_time = execution.event.focus_time.sum() を計算する
| usage_time >= 30min の場合
```

</details>


---

# Agent Instructions: 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/investigations/investigations-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.
