Splunk Search

How to edit my search to only show top 5 IPs by Office?

rus7am
Explorer

Hello,

We have this search below:

stats count(eval(State="OPEN")) as "Open", count(eval(State="CLOSED")) as "Closed" by Office, City, IP  | sort City, Office, -Open

And results in this table:

City Office IP Open Closed
City1 Office1 IP1 30
City1 Office1 IP2 18
City1 Office1 IP3 10
City1 Office1 IP4 5
City1 Office1 IP5 4
City1 Office1 IP6 1
City1 Office1 IP7 1
City1 Office2 IP1 30
City1 Office2 IP2 28
City1 Office2 IP3 20
City1 Office2 IP4 19
City1 Office2 IP5 18
City1 Office2 IP6 17
City1 Office2 IP7 10
City1 Office2 IP8 1

Is it possible to limit it to display only the top 5 IPs by Office?

City Office IP Open Closed
City1 Office1 IP1 30
City1 Office1 IP2 18
City1 Office1 IP3 10
City1 Office1 IP4 5
City1 Office1 IP5 4
City1 Office2 IP1 30
City1 Office2 IP2 28
City1 Office2 IP3 20
City1 Office2 IP4 19
City1 Office2 IP5 18
City2 Office1 ...

Tags (3)
0 Karma

jtrucks
Splunk Employee
Splunk Employee

Use top:

... |top limit=5 IP by Office
--
Jesse Trucks
Minister of Magic

rus7am
Explorer

Top removes City and Open columns. And Top does not use values in Open column.

0 Karma
Get Updates on the Splunk Community!

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...

New! Splunk Observability Search Enhancements for Splunk APM Services/Traces and ...

Regardless of where you are in Splunk Observability, you can search for relevant APM targets including service ...

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...