Getting Data In

convert hours minutes to epoch time

architkhanna
Path Finder

I have a collumn which has values like 2h 50 m ,3h 10 m etc.
Is there a way to convert this to a value like 2.50,3.10 etc

Any leads would help.
TIA

0 Karma

vnravikumar
Champion

Hi

Try this

| makeresults 
| eval test="2h 50 m ,3h 10 m" 
| makemv delim="," test 
| mvexpand test 
| eval test=replace(replace(test,"h\s","."),"\s{0,}m\s{0,}","") 
| mvcombine delim="," test 
| nomv test
0 Karma

493669
Super Champion

You can use regex like below-

|rex mode=sed field=yourcolumnname "s/(\d+)h\s*(\d+).*/\1.\2/g"
0 Karma
Get Updates on the Splunk Community!

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...