Splunk Search

Time extraction from string?

asifhj
Path Finder

I have following values in a field

+000 00:00:00.00

+000 00:00:00.03

+000 00:00:43.18

+000 00:00:20.69

+000 00:00:00.04

+000 00:00:00.01

+000 00:00:00.03

I tried the following query to extract

...| eval t = strftime(strptime(CPU_USED,"+%3N %T.%Q"),"%3N %T.%Q") | table t, CPU_USED

I am getting the output as follows

000 00:00:00.000

000 00:00:00.000

000 00:00:43.000

000 00:00:20.000

000 00:00:00.000

000 00:00:00.000

000 00:00:00.000

As u can see I am unable to get the last two digits basically they are milliseconds.

And suggestions?

Regards

Asif J.

0 Karma

adityapavan18
Contributor

Dude..%3N & %Q both denote milliseconds.
http://docs.splunk.com/Documentation/Splunk/6.0.3/SearchReference/Commontimeformatvariables

So i guess splunk timestamp processor is confused..use only one and hopefully it should work

0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...