Splunk Search

chart on basis on time

LauraBre
Communicator

Hello,

This is my search :

tag::source="TokenizerWatchdogSplunk" Service_Type="*" | eval series=case(Service_Type="T2D","detok",Service_Type="D2T","tok")|chart count by Requester, series

I have the number of tok and detok by requester in column. I want to have the same thing on basis on the time. How can I do it? If I add a field '_time' behind the last series, Splunk returns me an error.

Thanks by advance.

Tags (2)
0 Karma

LauraBre
Communicator

Ok, thanks. But how can do to have the time in dynamic. I want that in the dashboard, the users can change the time scale. Can't show two things one a same axis????

0 Karma

Ayn
Legend

If you don't specify a span argument to bucket it will choose an appropriate span itself, which might result in the behaviour you want.

0 Karma

Damien_Dallimor
Ultra Champion

Here is one potential approach. Bucket up your results based on _time, as in the below example, into 1 hour buckets.Adjust the span value to adjust the bucket duration you want.

tag::source="TokenizerWatchdogSplunk" Service_Type="*" | eval series=case(Service_Type="T2D","detok",Service_Type="D2T","tok")| bucket _time span=1h | stats count by Requester series _time
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Unlock What’s Next: The Splunk Cloud Platform at .conf25

In just a few days, Boston will be buzzing as the Splunk team and thousands of community members come together ...