Splunk Search

Need to change the _time to log event time

rashi83
Path Finder

Hi ,

I need to replace value of _time with special extracted log time event. I am using this search but its not working . 

Log event  : 20200625_22:44:35.090 (thread=1): User ID: xxxx

....| rex field=_raw "^(?P<newtime>[^ ]+)" | eval newtime =strptime(newtime, "%m/%d/%Y") | eval _time = 'newtime' | table newtime _time

 

I am trying to capture the time "20200625_22:44:35.090" in newtime and put this value in _time

 

Please help 

 

Labels (1)
0 Karma

anilchaithu
Builder

@rashi83 

I guess its with extracted time format & strptime function. Please try this

eval newtime =strptime(newtime,"%Y%m%d_%H:%M%:%S.%3N)

 

Hope this helps

0 Karma

rashi83
Path Finder

Saying invalid arguments in srptime function.

0 Karma
Get Updates on the Splunk Community!

Database Performance Sidebar Panel Now on APM Database Query Performance & Service ...

We’ve streamlined the troubleshooting experience for database-related service issues by adding a database ...

IM Landing Page Filter - Now Available

We’ve added the capability for you to filter across the summary details on the main Infrastructure Monitoring ...

Dynamic Links from Alerts to IM Navigators - New in Observability Cloud

Splunk continues to improve the troubleshooting experience in Observability Cloud with this latest enhancement ...