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!

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