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!

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...