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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...