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")
thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !

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")
thanks and best regards,
Sekar

PS - If this or any post helped you in any way, pls consider upvoting, thanks for reading !
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In December, the Splunk Threat Research Team had 1 release of new security content via the Enterprise Security ...

Why am I not seeing the finding in Splunk Enterprise Security Analyst Queue?

(This is the first of a series of 2 blogs). Splunk Enterprise Security is a fantastic tool that offers robust ...

Index This | What are the 12 Days of Splunk-mas?

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