Splunk Search

Controlling web click sorting behaviour

Lucas_K
Motivator

Is it possible to control how the web interface sorts table column data?

It seems to just sort in ascii or lexical order.

The issue I have is that I have some simple table data that contains dates like the following.

04/Apr/2013
10/Apr/2013
02/Mar/2013
09/Jan/2013

If the web interface sort button is clicked it sorts the list like this :

02/Mar/2013
04/Apr/2013
09/Jan/2013
10/Apr/2013

Where as the expection for a date sort is

09/Jan/2013
02/Mar/2013
04/Apr/2013
10/Apr/2013

I can however work around this by having timeformat as %Y-%m-%d but the client requested format is %d-%m-%y and to be able to sort via this column correctly.

I have the feeling that this is some hardcoded web interface issue right?

Tags (1)
0 Karma
1 Solution

jonuwz
Influencer

Right.

Splunk doesn't know that what you're displaying is a date.

So you need to have the column in a sortable format, then change the way its displayed.

Since you already mention is sorts ok when you have %Y-%m-%d, im guessing you're formating _time, or another epoch field ( in the example mydate )

instead of doing

| eval mydate=strftime(mydate,"%Y-%m-%d")

do

| fieldformat mydate=strftime(mydate,"%d/%b/%Y")

the underlying data is sortable, but the displayed values are readable dates, so sorting will work.

View solution in original post

jonuwz
Influencer

Right.

Splunk doesn't know that what you're displaying is a date.

So you need to have the column in a sortable format, then change the way its displayed.

Since you already mention is sorts ok when you have %Y-%m-%d, im guessing you're formating _time, or another epoch field ( in the example mydate )

instead of doing

| eval mydate=strftime(mydate,"%Y-%m-%d")

do

| fieldformat mydate=strftime(mydate,"%d/%b/%Y")

the underlying data is sortable, but the displayed values are readable dates, so sorting will work.

Lucas_K
Motivator

Thanks. That was it.

I originally used a convert using ctime from epoch. Doing it that way must lose its ability to sort.

0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Index This | What travels the world but is also stuck in place?

April 2026 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Discover New Use Cases: Unlock Greater Value from Your Existing Splunk Data

Realizing the full potential of your Splunk investment requires more than just understanding current usage; it ...

Continue Your Journey: Join Session 2 of the Data Management and Federation Bootcamp ...

As data volumes continue to grow and environments become more distributed, managing and optimizing data ...