Dashboards & Visualizations

How to get some particular values in top of a column?

pal_sumit1
Path Finder

I want display the result like below table

team name count
abc.com 10
bcd.com 20
cdf.com 30
abc.in 40
bcd.in 50

teams with ".com" present in one list say "COM" and team with ".in" is present in other list say "IN"

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

You can do that by creating a new field by which to sort the results. For example,

<your search> | eval sortField=case(like('team name',"%com"), 1, like('team name', "IN"), 2, 1=1, 99) | sort + sortField | fields - sortField | table "team name" count

The case statement can be expanded to include many more criteria, if desired. If you want to sort alphabetically, try this:

<your search> | rex field='team name' "\.(?<sortField>\w+) | sort + sortField | fields - sortField |  table "team name" count
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...

Splunk MCP & Agentic AI: Machine Data Without Limits

Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization uses ...