Splunk Dev

how to align values on X-axis

krishna1
Explorer

Iam trying to align values on X-axis in this order : ">3 days" ">5 days" ">15 days" ">30 days" ">100 days"
I have tried table command but its not giving me the expected output.

query:
|inputlookup acn_ticket_unresolved_dessertholdings_kv
| eval age=((now() - epoc_time_submitted)/86400),total_age=round(age,2)
|rangemap field=total_age ">3 days"=0-3.00 ">5 days"=3.01-15.00 ">15 days"=15.01-30.00 ">30 days"=30.01-100.00 ">100 days"=100.01-1000.00
| chart count as count1 over range by priority | rename priority as Priority


krishna1_0-1707368896056.png

 

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

The chart command will sort string lexicographically, so change your range map to deliver numbers (3, 5, 15, 30, 100), then convert to strings after the chart command

|inputlookup acn_ticket_unresolved_dessertholdings_kv
| eval age=((now() - epoc_time_submitted)/86400),total_age=round(age,2)
|rangemap field=total_age "3"=0-3.00 "5"=3.01-15.00 "15"=15.01-30.00 "30"=30.01-100.00 "100"=100.01-1000.00
| chart count as count1 over range by priority
| eval range=">".range." days" | rename priority as Priority
0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.
Get Updates on the Splunk Community!

.conf25 Global Broadcast: Don’t Miss a Moment

Hello Splunkers, .conf25 is only a click away.  Not able to make it to .conf25 in person? No worries, you can ...

Observe and Secure All Apps with Splunk

 Join Us for Our Next Tech Talk: Observe and Secure All Apps with SplunkAs organizations continue to innovate ...

What's New in Splunk Observability - August 2025

What's New We are excited to announce the latest enhancements to Splunk Observability Cloud as well as what is ...