Splunk Search

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

nick405060
Motivator

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

nick405060
Motivator

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")

Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

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