Splunk Search

Splunk Chart dynamic column header sorting

avadhutha
Explorer

I have a chart formed like below and it's dynamic columns are created based on processes date. By default now the column header sort is happing from lower to higher value but I am looking in a format where headers of processDates are higher to lower.

Query:

|chart latest(Count) as Count by Name ,ProcessDate

Current Output:

Name   20240101 20240102 20240103
xyzNANANA
123NANANANA

 

 

Expecting output:

Name   2024010320240102 20240101
xyzNANANA
123NANANANA

 

 

Labels (1)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust
| transpose 0 column_name=Date header_field=Name
| sort 0 -Date
| transpose 0 column_name=Name header_field=Date

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust
| transpose 0 column_name=Date header_field=Name
| sort 0 -Date
| transpose 0 column_name=Name header_field=Date

avadhutha
Explorer

Thank you mate for the help,  Below corrected one helped with faster results.

 

|chart latest(Count) as Count by ProcessDate,Name
|sort 0 - ProcessDate
| transpose 0 column_name=Name header_field=ProcDate

 

 

 

0 Karma

dural_yyz
Communicator

Try

| chart latest(Count) as Count by Name, ProcessDate
| sort ProcessDate desc

Found a very similar request under this previously answered question.

https://community.splunk.com/t5/Splunk-Search/How-to-display-column-results-in-descending-order/m-p/...

0 Karma

avadhutha
Explorer

No, it is not working

0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...