Getting Data In

convert time format

avi123
Explorer

Hi All, 

I have a splunk query returning output as:

STime

09:45

 

I want to convert it to hours. Expected output:

STime

9.75 hrs

 

How do I achieve this using splunk

0 Karma

richgalloway
SplunkTrust
SplunkTrust

This run-anywhere example should explain the process.

| makeresults 
| eval STime="9:45"
| rex field=STime "(?<hrs>\d+):(?<mins>\d+)"
| eval Hours=hrs + round(mins/60,2)
---
If this reply helps you, Karma would be appreciated.
Get Updates on the Splunk Community!

What's New in Splunk Cloud Platform 9.3.2411?

Hey Splunky People! We are excited to share the latest updates in Splunk Cloud Platform 9.3.2411. This release ...

Buttercup Games: Further Dashboarding Techniques (Part 6)

This series of blogs assumes you have already completed the Splunk Enterprise Search Tutorial as it uses the ...

Technical Workshop Series: Splunk Data Management and SPL2 | Register here!

Hey, Splunk Community! Ready to take your data management skills to the next level? Join us for a 3-part ...