Splunk Search

Does Splunk have the ability to sort by month-year?


I have data that looks like Jan-19 and I want to sort by it. Except I can't, because strptime("Jan-19","%b-%y") does not work, even though e.g. strptime("Jan-1-19","%b-%d-%y") does.

How do I workaround this (presumably extremely common but not documented or fixed) bug?

0 Karma


I posted this for the community so it could be documented. The best workaround I've seen was presented by @chrisyoungerjds:

strptime("1-" + "Jan-19","%d-%b-%y")

Take the 2021 Splunk Career Survey

Help us learn about how Splunk has
impacted your career by taking the 2021 Splunk Career Survey.

Earn $50 in Amazon cash!