Splunk Search

How to add another field using top limit command?

grotti
Engager

Hello! I need some help from splunkers!!!

 

I'm using the search index=notable | search status_label=Closed | top limit=5 rule_title in the Splunk Enterprise Security, to list top 10 rule_title values.

 

But i need to bring the field "comment" of each rule_title in the table.

 

Can please help me?

 

Tks!!!

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @grotti,

if you haven't too many comments for each row, you could use:

index=notable status_label=Closed 
| stats values(comment) AS comment BY rule_title
| sort 10 -count

Ciao.

Giuseppe

0 Karma

bowesmana
SplunkTrust
SplunkTrust

If the comment field is always the same for the rule, then just add the comment to the top command

index=notable 
| search status_label=Closed 
| top limit=5 rule_title comment
0 Karma
Get Updates on the Splunk Community!

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...

Splunk AppDynamics Agents Webinar Series

Mark your calendars! On June 24th at 12PM PST, we’re going live with the second session of our Splunk ...

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2025 SplunkTrust is officially open! If you ...