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!

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

Accelerating Observability as Code with the Splunk AI Assistant

We’ve seen in previous posts what Observability as Code (OaC) is and how it’s now essential for managing ...