Splunk Search

Top Results After Timechart

rhum_defintel
New Member

I don't really know how to explain this so I will do my best.

I have a bunch of data that I want to analyze. Each line represents an event and it contains a timestamp. I use the following command to narrow down the results to those during times where there is a lot of data in a short period of time.

sourcetype="csv-4" | timechart span="1m" count | eventstats avg(count) as threshold | where count/1.1 > threshold | eventstats median(count) as threshold | where count > threshold | timechart span="5m" count | where count > 0

In the data, there is a field called NAME. I want to find the top ten names within the filtered out results. I tried this but it did not work:

sourcetype="csv-4" | timechart span="1m" count | eventstats avg(count) as threshold | where count/1.1 > threshold | eventstats median(count) as threshold | where count > threshold | timechart span="5m" count | where count > 0 | top NAME

Could someone please help me?

Tags (2)
0 Karma

lguinn2
Legend

The problem is that you have summarized the data in the first timechart command - after that point you are working with the summarized data as it appears in the timechart. There is no NAME in the timechart results.

What exactly do you mean by "within the timechart results"? I think you could probably run a second search that would retrieve what you want, but I need to know a little more to offer any suggestions.

0 Karma

Ayn
Legend

Maybe use the search you currently have as a subsearch that feeds the time intervals of interest to an outer search.

rhum_defintel
New Member

How would I solve the summary problem?

0 Karma
Get Updates on the Splunk Community!

Splunk Classroom Chronicles: Training Tales and Testimonials (Episode 2)

Welcome to the "Splunk Classroom Chronicles" series, created to help curious, career-minded learners get ...

Index This | I am a number but I am countless. What am I?

January 2025 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  Happy New Year! We’re ...

What’s New in Splunk Enterprise 9.4: Tools for Digital Resilience

PLATFORM TECH TALKS What’s New in Splunk Enterprise 9.4: Tools for Digital Resilience Thursday, February 27, ...