Splunk Search

サーチ文の中でtime rangeを作成する方法

appleman
Contributor

サーチ文の中で、グラフを作成する為に自分でtime rangeを作成する方法はございますでしょうか。
例えば以下のようなサーチの場合で、結果ででてくる時間を1~10分間、11~20分間、21~30分間のようにグループ分けして、
チャート結果をよりわかりやすくする方法をご教示願います。

sourcetype=A status=pending OR status=success | fillnull value=NULL | transaction startswith="status=pending" endswith="status=success" | chart count by type duration useother=false

0 Karma
1 Solution

melonman
Motivator

出てくる時間というのは、おそらく、transactionの結果で出力されるdurationの事だとおもいます。

このdurationを集計し、1-10,11-20...という感じで、バケツを作ってあげるとできると思います。

... | transaction startswith="status=pending" endswith="status=success"
| bucket duration span=10
| chart count by type duration useother=false

いかがでしょうか。

View solution in original post

melonman
Motivator

出てくる時間というのは、おそらく、transactionの結果で出力されるdurationの事だとおもいます。

このdurationを集計し、1-10,11-20...という感じで、バケツを作ってあげるとできると思います。

... | transaction startswith="status=pending" endswith="status=success"
| bucket duration span=10
| chart count by type duration useother=false

いかがでしょうか。

sunrise
Contributor

chartコマンド前に、bucket(bin)コマンドを使っては如何でしょうか。
timechart span=2hを指定した時の開始時刻について - Splunk Community
bucket

alacercogitatus
SplunkTrust
SplunkTrust

あなたは英語で投稿する場合は、より多くの回答を得ることができます。しかし、あなたがであなたのデータが欲しいフォーマットに貼り付けることができているのサンプルを持っていますか?ピクチャまたはテーブルか何か?

Get Updates on the Splunk Community!

Stay Connected: Your Guide to January Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...

[Puzzles] Solve, Learn, Repeat: Reprocessing XML into Fixed-Length Events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...