Splunk Search

一定数値の範囲の数をカウントしたい

tonakano
Engager

ご教授ください。

今日の日付とデータの日付を比較し、差分(何日間)をdurationという名前で抽出ししました。
このdurationを一定の範囲の数をカウントしてビジュアライズしたいと考えたのですが、この範囲カウントが出来ませんでした。

・やりたいこと
duration 0~100 x個
duration 100~365 y個
duration 365~ z個
->x,y,zを棒グラフにしたい

stats countなどでもやれるかと思ったのですが、うまくいきませんでた。

0 Karma
1 Solution

HiroshiSatoh
Champion

レンジの値が100毎とかならBINを使う等も可能だと思いますが規則性がないならCASEを使ったほうがわかりやすいと思います。

 eval rang=case(duration<=100,"duration100",duration<=365,"duration365",1=1,"duration365over")
|stats count by rang

View solution in original post

0 Karma

HiroshiSatoh
Champion

レンジの値が100毎とかならBINを使う等も可能だと思いますが規則性がないならCASEを使ったほうがわかりやすいと思います。

 eval rang=case(duration<=100,"duration100",duration<=365,"duration365",1=1,"duration365over")
|stats count by rang
0 Karma

tonakano
Engager

ありがとうございます。無事出来ました!

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

Tech Talk Recap | Mastering Threat Hunting

Mastering Threat HuntingDive into the world of threat hunting, exploring the key differences between ...

Observability for AI Applications: Troubleshooting Latency

If you’re working with proprietary company data, you’re probably going to have a locally hosted LLM or many ...

Splunk AI Assistant for SPL vs. ChatGPT: Which One is Better?

In the age of AI, every tool promises to make our lives easier. From summarizing content to writing code, ...