Knowledge Management

Using mean(x) in summary search run every 5 minutes - when running a report on summary index using mean(x) per day or month, will that give the same result?

JYTTEJ
Communicator

Hi - I need to calculate the mean(response time) for at complete month based on summary index.

The summary index search has to run every 5 minutes - selecting last 5 minutes of data.

The search will look like this: Search.... |sistats mean(response time) by xxx yyyy www ttt

The monthly report search will look like this: index=summary REPORT=MEANRESP|timechart span=1month mean(response time)

QUESTION: Will the search run on the summary index give the same result as if I made the search run on the actual transaction log?

Tags (2)
0 Karma
1 Solution

somesoni2
SplunkTrust
SplunkTrust

There will be some differences (magnitude depend upon the data) as there will be little rounding in mean calculation of summary indexes and subsequent mean calculation during data fetch from. See this runanywhere search example and compare the results.

SET 1
simulating summary index
| gentimes start=-1 | eval temp=mvrange(1,200,2) | table temp | mvexpand temp | eval data=temp+1 | bucket span=5s data | stats mean(temp) as temp by data | stats mean(temp) as temp

Direct calculation
| gentimes start=-1 | eval temp=mvrange(1,200,2) | table temp | mvexpand temp | eval data=temp+1 | stats mean(data) as temp

SET 2
simulating summary index
| gentimes start=-1 | eval temp=mvrange(2,200,2) | table temp | mvexpand temp | eval data=temp+1 | bucket span=5s data | stats mean(temp) as temp by data | stats mean(temp) as temp

Direct calculation
| gentimes start=-1 | eval temp=mvrange(2,200,2) | table temp | mvexpand temp | eval data=temp+1 | stats mean(data) as temp

View solution in original post

somesoni2
SplunkTrust
SplunkTrust

There will be some differences (magnitude depend upon the data) as there will be little rounding in mean calculation of summary indexes and subsequent mean calculation during data fetch from. See this runanywhere search example and compare the results.

SET 1
simulating summary index
| gentimes start=-1 | eval temp=mvrange(1,200,2) | table temp | mvexpand temp | eval data=temp+1 | bucket span=5s data | stats mean(temp) as temp by data | stats mean(temp) as temp

Direct calculation
| gentimes start=-1 | eval temp=mvrange(1,200,2) | table temp | mvexpand temp | eval data=temp+1 | stats mean(data) as temp

SET 2
simulating summary index
| gentimes start=-1 | eval temp=mvrange(2,200,2) | table temp | mvexpand temp | eval data=temp+1 | bucket span=5s data | stats mean(temp) as temp by data | stats mean(temp) as temp

Direct calculation
| gentimes start=-1 | eval temp=mvrange(2,200,2) | table temp | mvexpand temp | eval data=temp+1 | stats mean(data) as temp
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 ...