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!

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...