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
Super Champion

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
Super Champion

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

Register for .conf21 Now! Go Vegas or Go Virtual!

How will you .conf21? You decide! Go in-person in Las Vegas, 10/18-10/21, or go online with .conf21 Virtual, 10/19-10/20.