Splunk Search

Sort not working when change the time format

Pajkow
Engager

Hi all, got the problem with sort,

When I change the time format from default e.g. 2020-05-08 19:46:20 to this :08/05/20 19:46:20 by the use  this conversion command:  | eval _time=strftime(_time,"%d/%m/%y %H:%M:%S") the sort function does not work.

To overcome this, I can put the sort command e.g.  "  | sort -_time " prior eval command but this does not resolve the main Splunk build in feature .i. e. arrows up and down next to the table headers. 

Since I changed the time output format the sort will work only on one page with results, if there are multiple pages with results, this will not work, is this normal?

0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

You possibly don't want to change _time itself, but you can change the way it is displayed e.g. fieldformat _time=strftime(_time,"%d/%m/%y %H:%M:%S")

View solution in original post

0 Karma

ITWhisperer
SplunkTrust
SplunkTrust

You possibly don't want to change _time itself, but you can change the way it is displayed e.g. fieldformat _time=strftime(_time,"%d/%m/%y %H:%M:%S")

0 Karma
Get Updates on the Splunk Community!

Splunk Enterprise Security(ES) 7.3 is approaching the end of support. Get ready for ...

Hi friends!    At Splunk, your product success is our top priority. With Enterprise Security (ES), we're here ...

Splunk Enterprise Security 8.x: The Essential Upgrade for Threat Detection, ...

Watch On Demand the Tech Talk, and empower your SOC to reach new heights! Duration: 1 hour  Prepare to ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...