Splunk Enterprise

How to convert time format to readable time format?

Srubhi
Path Finder

We have data fields in the format, for example, 12Jun22 I need to format like 12-06-2022 
as shown in the below table:

date expected format
12Jun22 12-06-20222
13Jun22 13-06-2022
Labels (1)
Tags (1)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Splunk has the strptime and strftime functions for that purpose.

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

View solution in original post

Srubhi
Path Finder

Thanks @richgalloway it worked!

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Splunk has the strptime and strftime functions for that purpose.

| eval date=strftime(strptime(date, "%d%b%y"), "%d-%m-%Y")
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Introducing the 2024 SplunkTrust!

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

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...