Splunk Search

How to create a scatter chart over time and duration, with a line for max duration?

Chinmai
Explorer

Hello Guys,

I have a requirement where I need to create a scatter chart of tickets. I need to have a ticket created time on the x-axis, duration in the y-axis (duration=now()-ticket_created_time).

whenever a ticket reaches it max duration, ticket should disappear. For that, we need to have a line for max duration.

Can anyone please help me in this?

Many Thanks in advance.

0 Karma

DalJeanis
Legend

It occurs to me that your requirement is .... a less than useful selection for a visualization.

All the points on the "scatterplot" are always going to be along a straight line. (In practice it may "jig" a little, but in reality it's mathematically straight.) If your max duration is (for example) 20 days, then the far left point possible is 19 days ago, and the left edge and top edge of the chart both represent a ticket aged 20 days. Basically, duration and start date/time are the same measurement, so a graph that compares them is a waste of electrons.

Here's a run-anywhere code to generate random test data and show you a graph, assuming that your max duration was 20 days.

| makeresults count=100 | eval timeago=(random()% 1000) | eval timeago=1.6*timeago*timeago+ (random()% 10000)| eval _time = _time-timeago | bin _time  span=6h | table _time | eval duration=round((now()-_time)/86400,2) | timechart avg(duration) span=12h
0 Karma

Chinmai
Explorer

Hello,

Thanks for your answer. Assume that is a 24 hrly chart, with x-axis showing last 24 hrs with span=1hr and max duration as 8hrs, then what would be the search query?

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...