Splunk Search

How to use timechart to get two different timechart averages, then get a sum of those two values in each time span?

zqmirza
New Member

I am using the search below to get two different averages from two different indexes:

index=a| bucket _time span=4h | stats avg(session_count) as X by _time
| append [search index=b| bucket _time span=4h | stats avg(session_count) as Y by _time] 

Now I want a time chart to sum X & Y in each of the 4 hour time frames
Can you please see the search I wrote and suggest how to get this result?

0 Karma
1 Solution

renjith_nair
SplunkTrust
SplunkTrust

Try this

(index=a OR index=b)|timechart span=4h usenull=f avg(session_count) by index|eval sum=a+b
Happy Splunking!

View solution in original post

renjith_nair
SplunkTrust
SplunkTrust

Try this

(index=a OR index=b)|timechart span=4h usenull=f avg(session_count) by index|eval sum=a+b
Happy Splunking!

zqmirza
New Member

yes, it's working just need to use the fields - a, b to only show the sum. Great! Thanks.

0 Karma
Get Updates on the Splunk Community!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...