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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...