Splunk Search

Timechart vs chart behaviour

ghildiya
Explorer

When I run following query:

 

.... | bin _time span=5m | timechart  avg(responseTime)

 

 

(responseTime is an extracted field)

What I understand of this query is this:

Divide timeline in a series of buckets of 5 minutes duration each, find average of responseTime  for each such bucket and plot the graph(average of responsetime as Y axis, for timechart X axis is always time).

I see graph as:

timechart.PNGSo I see graph is not continuous, as there may be time slots when there is no record and hence no data point.

Now, if I change my query to:

 

.... | bin _time span=5m | chart  avg(responseTime) by _time

 

 

My understanding is that this query should behave same as first one.

But graph I see is as:

chart.PNG In contrast to first graph, this one is continuous without any break.

I am not able to understand why the two queries behave differently.

Labels (2)
0 Karma
1 Solution

richgalloway
SplunkTrust
SplunkTrust

Both commands are supposed to fill in missing values by default.  Try this to see if the output is any different.

.... | timechart span=5m avg(responseTime) ``` No bin command```

You can try this to see if you get results similar to what you got from timechart.

.... | bin _time span=5m | chart cont=false avg(responseTime) by _time

 

---
If this reply helps you, Karma would be appreciated.

View solution in original post

L0gik2
New Member

How can you break this out into multiple lines from here?  For example I am working on a line chart of speed by vehicle across mileposts.  I can do speed by vehicle or speed by milepost.  

To get speed at mileposts I have used:

|  chart values(speed) BY Milepost

 

X axis would be mileposts, Y axis is speed and then line by Vehicle_ID

0 Karma

richgalloway
SplunkTrust
SplunkTrust

Both commands are supposed to fill in missing values by default.  Try this to see if the output is any different.

.... | timechart span=5m avg(responseTime) ``` No bin command```

You can try this to see if you get results similar to what you got from timechart.

.... | bin _time span=5m | chart cont=false avg(responseTime) by _time

 

---
If this reply helps you, Karma would be appreciated.

ghildiya
Explorer

Yes, the first query results in a continuous curve. 

 

So , the difference between mine and yous query is that I have explicitly used 

| bin _time span=5m |

 

..while you have used span with timchart.

Can you explain how does it make difference conceptually?

Tags (1)
0 Karma

richgalloway
SplunkTrust
SplunkTrust
I wish I knew. 😉
---
If this reply helps you, Karma would be appreciated.
0 Karma

ghildiya
Explorer

Upvoted already.

Tags (1)
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!

Community Content Calendar, September edition

Welcome to another insightful post from our Community Content Calendar! We're thrilled to continue bringing ...

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

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