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!

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI! Discover how Splunk’s agentic AI ...

[Puzzles] Solve, Learn, Repeat: Dereferencing XML to Fixed-length events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Stay Connected: Your Guide to December Tech Talks, Office Hours, and Webinars!

What are Community Office Hours? Community Office Hours is an interactive 60-minute Zoom series where ...