Splunk Search

Plot a line chart to compare against 2 time ranges by a specific field

splunker9999
Path Finder

Hello Community,  I am looking to Plot a line chart to compare against 2 time ranges by a specific field.

This is for JIRA metrics.

For example I have 3 fields
Created_time 
2020-10-29T03:49:09.000-0700

resolved_time
2021-01-06T15:26:23.000-0800

Ticket:
ABC123

Show a line chart with 2 legends created_time, resolved_time by ticket. 

This will help me compare against when a ticket opened vs closed.

Labels (2)
Tags (1)
0 Karma

splunker9999
Path Finder

Hello @bowesmana.

Thanks for the response.

I will try this logic and see how this works. My y-axis will be  count of tickets created vs closed everyday

Actually I am not looking for duration, this report is for management where they will see 2 lines showing the count of tickets created vs closed

0 Karma

bowesmana
SplunkTrust
SplunkTrust

@splunker9999 

Is your x-axis meant to be time, if so, what is your y-axis? 

Perhaps you are trying to see duration of ticket, in which case, you could calculate duration by subtracting created from resolved time, e.g.

 

| eval ct=strptime(Created_time, "%FT%T.%Q%z")
| eval rt=strptime(resolved_time, "%FT%T.%Q%z")
| eval duration=(rt-ct)/86400

 

which would give you duration in days and then you could use timechart to plot the y-axis duration over the created or resolved time with

 

| eval _time=ct
| timechart max(duration) by ticket

 

change _time=rt to get the x-axis as closure time.

Note that timechart will give you 10 tickets, unless you use limit=X

Is that what you are after?

  

0 Karma
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

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 ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...