Splunk Search

How do I extract top values by a specific field and have them display along with corresponding fields in a table command?

nivekko
New Member
index=* sourcetype=* host=*  | search Event=176 | top limit=20 User| table Location, Event, User, Address, Time

It displays the table but my columns with the fields Location, User, Address and Time appear to be empty. Any reason why?

0 Karma

sundareshr
Legend

Try this

index=* sourcetype=* host=*  Event=176 | stats count list(Location) as L, list(Event) as e, list(Address) as a, list(_time) as t  by User | sort 20 - count | eval z=mvzip(l, mvzip(e, mvzip(a, t))) | rex field=z "(?<Location>[^\,]+)\,(?<Event>[^\,]+)\,(?<Address>[^\,]+)\,(?<Time>.*) | eval Time=strftime(Time, "%x %X") | table Location, Event, User, Address, Time
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 ...