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!

See just what you’ve been missing | Observability tracks at Splunk University

Looking to sharpen your observability skills so you can better understand how to collect and analyze data from ...

Weezer at .conf25? Say it ain’t so!

Hello Splunkers, The countdown to .conf25 is on-and we've just turned up the volume! We're thrilled to ...

How SC4S Makes Suricata Logs Ingestion Simple

Network security monitoring has become increasingly critical for organizations of all sizes. Splunk has ...