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!

Introducing the 2024 Splunk MVPs!

We are excited to announce the 2024 cohort of the Splunk MVP program. Splunk MVPs are passionate members of ...

Splunk Custom Visualizations App End of Life

The Splunk Custom Visualizations apps End of Life for SimpleXML will reach end of support on Dec 21, 2024, ...

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...