Splunk Search

need to know a rough idea of how many times something occurred

frussell
New Member

As a system administrator, sometime I only need to know a rough idea of how many times something occurred. For example, if I'm looking to see how many times a file has been served by Apache - but I'm looking at millions of hits over the course of a few weeks - I don't need to know exactly how many, I'm just looking for a trend on when it started.

Tags (1)
0 Karma

Lowell
Super Champion

Check out the timechart and/or bucket commands. Splunk doesn't really have any concept of just giving you an "rough idea", you have to look at all the results. One exception may be if you can find the trends you are looking for by looking just at your indexing volume metrics, which sometimes works, but that can be more tricky and there are some gotchas.

If you are looking at finding trends long term, then summary indexing is certainly the recommended way to go with this kind of thing. Otherwise, you simply have to run a very long running search.

A simple count by time period search would be something like:

sourcetype=access_log | timechart count span=1h

Keep in mind that this is essentially the same thing that the default time-line shows you in the default search view. I often find that it does a good enough job for many simple trends, but you can use the search above to get a more precise picture.

Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...