Splunk Search

Convert YYYYMMDD number to DD.MM.YYYY format

ckunath
Communicator

Hello,

I am trying to convert a field value which contains a number in timeformat YYYYMMDD to DD.MM.YYYY

I tried several converting methods but it always end up with a whacky date, not the one that I require.

Can anyone help me out?

0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

This should do the job.

... | eval bar=strftime(strptime(foo, "%Y%m%d"),"%d.%m.%Y") | ...
---
If this reply helps you, Karma would be appreciated.

View solution in original post

richgalloway
SplunkTrust
SplunkTrust

This should do the job.

... | eval bar=strftime(strptime(foo, "%Y%m%d"),"%d.%m.%Y") | ...
---
If this reply helps you, Karma would be appreciated.

ckunath
Communicator

Thanks alot!

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

WATCH NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If exploited, ...

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...