Dashboards & Visualizations

How to order the ranges display in tables and charts, when using the rangemap command

aryamehr360
New Member

I want to order range from low amount of min/hour to high,
like this :
1S-1M, 1M-30M, 30M-1H, 1H-2H, 2H-3H, 3H-4H, 4H-5H, 5H-8H, 8H-10H, 10H-15H, 15H-More

I use this command;

| rangemap field=duration 1S-1M=0-60 1M-30M=61-1800 30M-1H=1801-3600 1H-2H=3601-7200 2H-3H=7201-10800 3H-4H=10801-14400 4H-5H=14401-18000 5H-8H=18001-28800 8H-10H=28801-36000 10H-15H=36001-54000 15H-More=54001-9999999999 
| chart count by range

and I get this order range;
alt text

and I want to order them from 1S-1M, 1M-30M, 30M-1H, ... , 10H-15H, 15H-more.

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

The range column looks to be sorted alphbetically, If you want a different sort, add a field to sort on.

| rangemap field=duration 1S-1M=0-60 1M-30M=61-1800 30M-1H=1801-3600 1H-2H=3601-7200 2H-3H=7201-10800 3H-4H=10801-14400 4H-5H=14401-18000 5H-8H=18001-28800 8H-10H=28801-36000 10H-15H=36001-54000 15H-More=54001-9999999999 
| chart count by range
| eval sorter = case(range="1S-1M", 1, range="1M-30M", 2, range="30M-1H", 3, range="1H-2H", 4, range="2H-3H", 5, range="3H-4H", 6, range="4H-5H", 7, range="5H-8", 8, range="8H-10H", 9, range="10H-15H", 10, range="15H-More", 11, 1==1, 99)
| sort sorter | fields - sorter
---
If this reply helps you, Karma would be appreciated.

View solution in original post

0 Karma

richgalloway
SplunkTrust
SplunkTrust

The range column looks to be sorted alphbetically, If you want a different sort, add a field to sort on.

| rangemap field=duration 1S-1M=0-60 1M-30M=61-1800 30M-1H=1801-3600 1H-2H=3601-7200 2H-3H=7201-10800 3H-4H=10801-14400 4H-5H=14401-18000 5H-8H=18001-28800 8H-10H=28801-36000 10H-15H=36001-54000 15H-More=54001-9999999999 
| chart count by range
| eval sorter = case(range="1S-1M", 1, range="1M-30M", 2, range="30M-1H", 3, range="1H-2H", 4, range="2H-3H", 5, range="3H-4H", 6, range="4H-5H", 7, range="5H-8", 8, range="8H-10H", 9, range="10H-15H", 10, range="15H-More", 11, 1==1, 99)
| sort sorter | fields - sorter
---
If this reply helps you, Karma would be appreciated.
0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...