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!

Troubleshooting the OpenTelemetry Collector

  In this tech talk, you’ll learn how to troubleshoot the OpenTelemetry collector - from checking the ...

Adoption of Infrastructure Monitoring at Splunk

  Splunk's Growth Engineering team showcases one of their first Splunk product adoption-Splunk Infrastructure ...

Modern way of developing distributed application using OTel

Recently, I had the opportunity to work on a complex microservice using Spring boot and Quarkus to develop a ...