Splunk Search

Date and Time format for not an epoch format

srinivas_gowda
Path Finder

Hello all,

 

I have been getting the data and time format in the below way. How do I convert it to the given readable format

 

20210901225446 -> 2021-09-01 22:54:46

20210901224509 -> 2021-09-01 22:45:09

 

Thank you.

Labels (4)
0 Karma
1 Solution

isoutamo
SplunkTrust
SplunkTrust

Hi

there is couple of ways to do it. Here is one

| makeresults
| eval time = "20210901225446"
| eval nTime = strftime(strptime(time,"%Y%m%d%H%M%S"), "%F %T")
| table time nTime

r. Ismo 

View solution in original post

isoutamo
SplunkTrust
SplunkTrust

Hi

there is couple of ways to do it. Here is one

| makeresults
| eval time = "20210901225446"
| eval nTime = strftime(strptime(time,"%Y%m%d%H%M%S"), "%F %T")
| table time nTime

r. Ismo 

Get Updates on the Splunk Community!

Accelerate Service Onboarding, Decomposition, Troubleshooting - and more with ITSI’s ...

Accelerate Service Onboarding, Decomposition, Troubleshooting - and more!  Faster Time to Value Managing and ...

New Release | Splunk Enterprise 9.3

Admins and Analyst can benefit from:  Seamlessly route data to your local file system to save on storage ...

2024 Splunk Career Impact Survey | Earn a $20 gift card for participating!

Hear ye, hear ye! The time has come again for Splunk's annual Career Impact Survey!  We need your help by ...