Splunk Search

Top & Fields command

anasshsa
Engager
index=uberAgent 
| top 5 SessionID by host | fields - Anzahl, precent

This code returns all events in the index instead of five and removes no counts and percent fields. Who can be the problem?alt text

Tags (2)
0 Karma

somesoni2
SplunkTrust
SplunkTrust

Your query is fetching top 5 sessionID for each host (all hosts will be shown). What was your requirement?

Regarding removing the fields, the percent field name is misspelled (written as precent) hence it's not removed. For removing count, try to use field name count itself. (try | fields - count, percent)

0 Karma

niketn
Legend

@somesoni2 actually better would be to use showperc=f and showcount=f arguments in the top command itself.

| top 5 SessionID by host showperc=f showcount=f

@anasshsa your query id giving you top 5 sessions for each host. If that is your requirement you can try the following:

 index=uberAgent 
| top 5 SessionID by host showperc=f 
| xyseries host SessionID count

Please let us know if you are looking for something else.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...