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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...