Getting Data In

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

Real_captain
Path Finder

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!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...