0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 1 year has passed since last update.

Splunk: サーチ実行時の警告/エラーメッセージ(maxresultrows関連)

Last updated at Posted at 2022-06-28

はじめに

Splunkにてサーチを実行した際、何らかの上限抵触を示す警告またはエラーメッセージ表示に出くわされた方もいらっしゃるかと思います。
Splunkではサーチ処理を含む各種上限設定がデフォルトで行われており、主にlimits.conf上にて定義がされています。

今回は上限設定の一つとして"maxresultrows"を取り上げ、設定内容及び上限を超えた場合の挙動についてご紹介します。

上限を超えた場合の挙動については、Splunk Documentation上で明確に記載されていない場合があります。
本稿記載の内容は、あくまで筆者の経験や実施した検証における挙動に基づき記載したものであり、サーチ内容や環境条件等により異なる挙動、または実際の仕様と異なる可能性があることをご了承下さい。

前提

  • Splunk Enterpriseバージョン
    • v8.2.2

メッセージ例

Error in 'top' command: The limit must be <= 50000.

image.png

説明

topコマンド実行時、結果出力行数の上限設定を超えたことを示すメッセージとなります。

  • Maximum number of result rows to create.
  • If not specified, uses the value set for 'maxresultrows' in the [searchresults] stanza, which is 50000 by default.
  • Default: 50000

"maxresultrows"上限を超えた場合の影響

"maxresultrows"上限を超えた場合の影響ですが、上限設定自体の適用箇所(対象とするスタンザ)が複数あり、影響動作がそれぞれ異なります。

一般的な影響:[searchresults]

  • Configures the maximum number of events are generated by search commands which grow the size of your result set (such as multikv) or that create events. Other search commands are explicitly controlled in specific stanzas below.
  • This limit should not exceed 50000.
  • Default: 50000
  • 影響範囲
    • 各コマンド毎に異なります。
      • 本稿では、例としてeventstats/streamstatsコマンド利用時の影響を記載します。
  • 上限超過時の動作(eventstats/streamstatsコマンド)
    • eventstatsコマンド
      • "max_mem_usage_mb", "maxresultrows"設定値の両方とも上限に達した場合、サーチ処理が停止(サーチ結果切り捨て)となります。
    • streamstatsコマンド
      • "max_mem_usage_mb", "maxresultrows"設定値の両方とも上限に達した場合、サーチ処理が停止(サーチ結果切り捨て)となります。

stats/sistatsコマンドに対する影響:[stats] [sistats]

  • Maximum number of rows allowed in the process memory.
  • When the search process exceeds "max_mem_usage_mb" and "maxresultrows", data is sent to the disk.
  • If not specified, uses the value set for 'maxresultrows' in the [searchresults] stanza, which is 50000 by default.
  • Default: 50000
  • 影響範囲
    • stats/sistatsコマンド実行時におけるサーチ処理挙動
  • 上限超過時の動作
    • "max_mem_usage_mb", "maxresultrows"設定値の両方とも上限に達した場合、メモリでなくディスク領域をサーチ処理として利用します。
    • ディスク利用に処理が寄った場合、サーチ所要時間が長くなる可能性があります。

top/rareコマンドに対する影響:[top] [rare]

  • Maximum number of result rows to create.
  • If not specified, uses the value set for 'maxresultrows' in the [searchresults] stanza, which is 50000 by default.
  • Default: 50000
  • 影響範囲
    • top/rareコマンド利用時におけるサーチ結果
  • 上限超過時の動作
    • top/rareコマンド利用時、コマンドオプションの表示件数(limit=XXX)に対して"maxresultrows"設定値を超える値を指定した場合、サーチエラーとなります。

REST API関連操作に対する影響:[restapi]

  • Maximum result rows to be returned by /events or /results getters from REST API.
  • Default: 50000
  • 影響範囲
    • REST API経由でのサーチ結果取得時に一度で取得できる行数
    • ダッシュボードにおけるグラフ等での可視化時に表示可能な情報件数(内部的にREST APIを利用しているため)
  • 上限超過時の動作:
    • REST API経由での検索結果取得
      • 上限を超えるイベント数を取得する場合は、オフセット値を取得して順次取得する必要があります(結果の全てが取得不可となる訳ではありません)。
    • ダッシュボードにおけるグラフ等の可視化表示時における表示件数
      • 上限を超える情報は表示されません(一部欠損した状態で表示されます)。

参照

0
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
0
0

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?