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
Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Dynamic formatting from XML events

This challenge was first posted on Slack #puzzles channelFor a previous puzzle, I needed a set of fixed-length ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Stronger Security with Federated Search for S3, GCP SQL & Australian Threat ...

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