Splunk Enterprise

Timechart Sort Asc/Desc

kavyakanne
Engager

After timechart can the columns be sorted either in Ascending/Descending order

 

 

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

You need to have your column named numerically, then transpose, sort, and transpose back again. If you need to you can reset the numeric values after the sort

| makeresults count=5000
| eval response=random()%30
| streamstats count as row 
| eval _time=_time-(row%60)*60
| timechart limit=0 useother=f count by response



| transpose 0 header_field=_time
| sort 0 column
| where column!="_span"
| transpose 0 header_field=column column_name=_time

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You need to have your column named numerically, then transpose, sort, and transpose back again. If you need to you can reset the numeric values after the sort

| makeresults count=5000
| eval response=random()%30
| streamstats count as row 
| eval _time=_time-(row%60)*60
| timechart limit=0 useother=f count by response



| transpose 0 header_field=_time
| sort 0 column
| where column!="_span"
| transpose 0 header_field=column column_name=_time
0 Karma

kavyakanne
Engager

ok!

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

Try the solution I proposed - transpose, sort, (remove system-generated field), transpose

0 Karma

johnhuang
Motivator

When you generate the hour range, convert 1 digit hour to 2 digit, e.g. 00-01, 01-02, etc.

0 Karma
Get Updates on the Splunk Community!

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...

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, ...