Splunk Search

How to convert time from file to timestamp

tgdvopab
Path Finder

Hello

I have a extracted field from the raw data including time data like:

16.09.23;11:05:11:652

Now I want to convert this field like the _time field in splunk.

How can I convert this?

Thanks a lot!

0 Karma
1 Solution

inventsekar
SplunkTrust
SplunkTrust

currentTimeField example - 16.09.23;11:05:11:652
considering _time as example - 2016-09-26 11:00

| eval finalTimeFormat = strftime(strptime(currentTimeField,"%y.%m.%d;%H:%M:%S:%3N"),"%Y-%m-%d %H:%M")

View solution in original post

inventsekar
SplunkTrust
SplunkTrust

currentTimeField example - 16.09.23;11:05:11:652
considering _time as example - 2016-09-26 11:00

| eval finalTimeFormat = strftime(strptime(currentTimeField,"%y.%m.%d;%H:%M:%S:%3N"),"%Y-%m-%d %H:%M")
Get Updates on the Splunk Community!

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...