Splunk Search

Chart by Duration (D+HH:MM:SS) which is in string format?

deodeshm
Explorer

Hello,

I used below to convert seconds into D+HH:MM:SS format which is now in string format. However, I want to create charts based on duration taken to publish the turn around times.

eval strSecs=tostring(secs,"duration")

 How can I use these strings to create chart or is there any way to convert seconds to HH:MM:SS format which is quantifiable and not a string?

 

Thanks,

Deovrat

Labels (2)
0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @deodeshm,

No, in general, if you convert a number in a string, it remains a string, you can eventually reconvert into a number.

Could you share your search to see if there's a different approach to use?

Ciao.

Giuseppe

0 Karma

deodeshm
Explorer

Thanks for the answer,  below is the search query, I can plot the chart with seconds but want the label in D+hh:mm:ss format, is there any way?

 

index=<>  | eval month=strftime(_time,"%B %Y") | rename fields.customfield_17410 AS alert_time | eval g_e_time = strptime(gsoc_engagement_time,"%Y-%m-%dT%H:%M:%S") | eval a_time = strptime(alert_time,"%Y-%m-%dT%H:%M:%S") | eval cl_time = strptime(closed_time,"%Y-%m-%dT%H:%M:%S") | eval mtta_diff = g_e_time-a_time | eval mttt_diff = cl_time - a_time | stats avg(mtta_diff) AS MTTA, avg(mttt_diff) AS MTTT by month | eval MTTA=tostring(round(MTTA,0), "duration") | eval MTTT=tostring(round(MTTT,0), "duration")

0 Karma

gcusello
SplunkTrust
SplunkTrust

Hi @deodeshm,

I am afraid that it is not possible to represent a string in a graph, the only method is to use a table next to the graph to allow a quick reading of the values.

Ciao.

Giuseppe

0 Karma
Get Updates on the Splunk Community!

Fall Into Learning with New Splunk Education Courses

Every month, Splunk Education releases new courses to help you branch out, strengthen your data science roots, ...

Super Optimize your Splunk Stats Searches: Unlocking the Power of tstats, TERM, and ...

By Martin Hettervik, Senior Consultant and Team Leader at Accelerate at Iver, Splunk MVPThe stats command is ...

How Splunk Observability Cloud Prevented a Major Payment Crisis in Minutes

Your bank's payment processing system is humming along during a busy afternoon, handling millions in hourly ...