Splunk Search

Date Format in required form

ncbshiva
Communicator

Hi i have a Date in the below form

201304
201306
201307

I want to convert to these to below form

APR-13
JUN-13
JUL-13

Please help me in this

Thanking you

Tags (1)
0 Karma
1 Solution

martin_mueller
SplunkTrust
SplunkTrust

You can do that with a combination of strptime and strftime, see http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions for reference.

View solution in original post

martin_mueller
SplunkTrust
SplunkTrust

You can do that with a combination of strptime and strftime, see http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/CommonEvalFunctions for reference.

martin_mueller
SplunkTrust
SplunkTrust

Try this:

... | eval newdate = upper(strftime(strptime(date+"01", "%Y%m%d"), "%b-%y"))
0 Karma

ncbshiva
Communicator

i tried to convert using above functions, but didn,t work.
Please help me .

0 Karma
Get Updates on the Splunk Community!

What's new in Splunk Cloud Platform 9.1.2312?

Hi Splunky people! We are excited to share the newest updates in Splunk Cloud Platform 9.1.2312! Analysts can ...

What’s New in Splunk Security Essentials 3.8.0?

Splunk Security Essentials (SSE) is an app that can amplify the power of your existing Splunk Cloud Platform, ...

Let’s Get You Certified – Vegas-Style at .conf24

Are you ready to level up your Splunk game? Then, let’s get you certified live at .conf24 – our annual user ...