Splunk Search

how can I create a top 5 list of multiple values from one source

heybails88
Path Finder

I have an index from a forwarder that looks something like this:
"index=indexname DEBUG Rule="Rule One" OR "Rule Two" OR "Rule Three" etc."
I'd like to build a summary of all the Rules that come in via the log that is being read by the forwarder. Something like a top 5 summary of Rules that came out. I've tried to parse through a lookup table, but that didn't do what I wanted. Having difficulty with something that should be pretty easy.

Tags (2)
0 Karma
1 Solution

heybails88
Path Finder

Ultimately what I needed was a regex extraction called "matched" which looked like this

matched\s(?P.*)

This added the events that came from log on the forwarder. Then create the top 5.

index=index matched=* |stats count by matched |sort - count

View solution in original post

0 Karma

mayurr98
Super Champion

Yes that is also will do.

0 Karma

somesoni2
Revered Legend

You need to define the rule based on which you want to find the top 5 rules. Example, if you want to find out top 5 Rule based on number of events, you can do like this

index=indexname DEBUG Rule="Rule One" OR Rule="Rule Two" OR Rule="Rule Three"...all rules that you're interested in..
| top 5 Rule

heybails88
Path Finder

Thanks for the info. A lookup table is what I need, which I had defined, but it wasn't right. However, I still need something else.

0 Karma
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 ...