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!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...