Getting Data In

How to convert the time from hh:mm:ss.6Q into hh:mm:ss ?

Real_captain
Explorer

HI 

Can someone please let me know how to convert the time from the format hh:mm:ss.6Q  to hh:mm:ss ?? 

 

 

Labels (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust

Use the strptime and strftime functions to convert time formats.

| eval timeField=strftime(strptime(timeField,"%H:%M:%S.%6Q"), "%H:%M:%S")

You also can use string manipulation to cut off the last 7 characters.

 

---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

Enter the Splunk Community Dashboard Challenge for Your Chance to Win!

The Splunk Community Dashboard Challenge is underway! This is your chance to showcase your skills in creating ...

.conf24 | Session Scheduler is Live!!

.conf24 is happening June 11 - 14 in Las Vegas, and we are thrilled to announce that the conference catalog ...

Introducing the Splunk Community Dashboard Challenge!

Welcome to Splunk Community Dashboard Challenge! This is your chance to showcase your skills in creating ...