<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: In summary indexing, why does the sitimechart gives different results than the timechart? in Knowledge Management</title>
    <link>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394253#M3394</link>
    <description>&lt;P&gt;Hi dwaddle, maybe I'm misunderstanding your request, but I included both searches above.&lt;/P&gt;

&lt;P&gt;index=perfmon host="UW2*" | sitimechart span=1h avg(cpu_load_percent) by host&lt;/P&gt;

&lt;P&gt;^ to create summary index&lt;/P&gt;

&lt;P&gt;index=summary host="UW2*" | timechart span=1h avg(cpu_load_percent) by host&lt;/P&gt;

&lt;P&gt;^ to pull from summary&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 20:04:27 GMT</pubDate>
    <dc:creator>dtrelford</dc:creator>
    <dc:date>2020-09-29T20:04:27Z</dc:date>
    <item>
      <title>In summary indexing, why does the sitimechart gives different results than the timechart?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394250#M3391</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I'm attempting to use summary indexing to store the following search that shows timechart average cpu usage for a group of servers:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfmon host="UW2*" | timechart span=1h avg(cpu_load_percent) by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It looks like this:&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5234iEB20D8265FE45674/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;When I try to use summary indexing to save this search as a report using sitimechart, the results are completely different:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=perfmon host="UW2*" | sitimechart span=1h avg(cpu_load_percent) by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5235i1F0DFAD8DAE6CF94/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;It looks like timechart and sitimechart behave differently. Why is this? How can I get the same results from sitimechart that I get with timechart?&lt;/P&gt;</description>
      <pubDate>Sat, 16 Jun 2018 11:25:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394250#M3391</guid>
      <dc:creator>dtrelford</dc:creator>
      <dc:date>2018-06-16T11:25:51Z</dc:date>
    </item>
    <item>
      <title>Re: In summary indexing, why does the sitimechart gives different results than the timechart?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394251#M3392</link>
      <description>&lt;P&gt;Hi @dtrelford,&lt;BR /&gt;
What about the statistics tab ? The avg should be same for a timestamp for both commands. &lt;BR /&gt;
SI-* commands add additional fields to the result to summarize as mentioned in &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.1.1/Knowledge/Usesummaryindexing#Fields_added_to_summary-indexed_data_by_the_si-_summary_indexing_commands"&gt;http://docs.splunk.com/Documentation/Splunk/7.1.1/Knowledge/Usesummaryindexing#Fields_added_to_summary-indexed_data_by_the_si-_summary_indexing_commands&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 11:30:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394251#M3392</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-06-17T11:30:18Z</dc:date>
    </item>
    <item>
      <title>Re: In summary indexing, why does the sitimechart gives different results than the timechart?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394252#M3393</link>
      <description>&lt;P&gt;You have not provided enough information to enable anyone to help you solve your problem.  It is likely you are misusing the sitimechart command, and/or have not made your summary generation search correctly.&lt;/P&gt;

&lt;P&gt;Share with us:&lt;/P&gt;

&lt;P&gt;[1]  The search you are using to make your summary index&lt;BR /&gt;
[2]  The search you are using to pull data from your summary index&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 15:40:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394252#M3393</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2018-06-17T15:40:38Z</dc:date>
    </item>
    <item>
      <title>Re: In summary indexing, why does the sitimechart gives different results than the timechart?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394253#M3394</link>
      <description>&lt;P&gt;Hi dwaddle, maybe I'm misunderstanding your request, but I included both searches above.&lt;/P&gt;

&lt;P&gt;index=perfmon host="UW2*" | sitimechart span=1h avg(cpu_load_percent) by host&lt;/P&gt;

&lt;P&gt;^ to create summary index&lt;/P&gt;

&lt;P&gt;index=summary host="UW2*" | timechart span=1h avg(cpu_load_percent) by host&lt;/P&gt;

&lt;P&gt;^ to pull from summary&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:04:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394253#M3394</guid>
      <dc:creator>dtrelford</dc:creator>
      <dc:date>2020-09-29T20:04:27Z</dc:date>
    </item>
    <item>
      <title>Re: In summary indexing, why does the sitimechart gives different results than the timechart?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394254#M3395</link>
      <description>&lt;P&gt;Here's the statistics tab for both, with the same timestamp. The CPU avg usage of 1.02% is what I'm looking to timechart. That value is not present in the sitimechart statistic results:&lt;/P&gt;

&lt;P&gt;timechart:&lt;/P&gt;

&lt;P&gt;_time   UW2SERVER01&lt;/P&gt;

&lt;P&gt;2018-06-17 09:00    1.0268111210652904&lt;/P&gt;

&lt;P&gt;sitimechart:&lt;/P&gt;

&lt;P&gt;_time   host    psrsvd_ct_cpu_load_percent  psrsvd_gc   psrsvd_nc_cpu_load_percent  psrsvd_sm_cpu_load_percent  psrsvd_v    psrsvd_vt_cpu_load_percent&lt;BR /&gt;
2018-06-17 09:00    UW2SERVER01 75  2243    75  80.72541951731340000000000  1   23&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:04:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394254#M3395</guid>
      <dc:creator>dtrelford</dc:creator>
      <dc:date>2020-09-29T20:04:30Z</dc:date>
    </item>
    <item>
      <title>Re: In summary indexing, why does the sitimechart gives different results than the timechart?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394255#M3396</link>
      <description>&lt;P&gt;OH I missed them, MY APOLOGIES!   Well that is strange, as you seem to have done it right.    Let me do some more digging&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 16:33:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394255#M3396</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2018-06-17T16:33:06Z</dc:date>
    </item>
    <item>
      <title>Re: In summary indexing, why does the sitimechart gives different results than the timechart?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394256#M3397</link>
      <description>&lt;P&gt;The &lt;CODE&gt;si&lt;/CODE&gt; commands - &lt;CODE&gt;sitimechart&lt;/CODE&gt;, &lt;CODE&gt;sitop&lt;/CODE&gt;, &lt;CODE&gt;sistats&lt;/CODE&gt; etc all save data in what is basically a serialized format called colloquially the "prestats" format.  You get new fields that are named with things like &lt;CODE&gt;psrsvd_X&lt;/CODE&gt; - these contain the "sufficient statistics" needed to make a summary index work.   Depending on the functions in your &lt;CODE&gt;stats&lt;/CODE&gt; (or &lt;CODE&gt;timechart&lt;/CODE&gt; - remember that &lt;CODE&gt;timechart&lt;/CODE&gt; is really just "stats with a funny hat") command, it may need to save different things in order to reconstruct a final result over your summary.&lt;/P&gt;

&lt;P&gt;For example, if you're summarizing &lt;CODE&gt;count()&lt;/CODE&gt;  or &lt;CODE&gt;sum()&lt;/CODE&gt;  then it's pretty each to just store the number or items counted, or the sum of them.   The sum of a set of sums is still something you just add up.   But, average is different.   If Splunk stored the average at each "sample" of the summary index, then averaged-the-averages you'd get a very close but not mathematically accurate summarization.  Instead, Splunk stores what the average is made of -- a count and a sum.  &lt;/P&gt;

&lt;P&gt;For some experimentation and an example, I'm using this metrics log data everyone has:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*metrics.log group=queue  | sitimechart span=1h avg(current_size_kb) by name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When I run this, I get a result with some funny &lt;CODE&gt;psrsvd&lt;/CODE&gt; fields in it, like &lt;CODE&gt;psrsvd_ct_current_size_kb&lt;/CODE&gt; and &lt;CODE&gt;psrsvd_sm_current_size_kb&lt;/CODE&gt;.   There are some others too, but I want to focus on these two.  These are, during the generation of the summary, the count and the sum.  Let's do some experimentation:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*metrics.log group=queue 
| sitimechart span=1h avg(current_size_kb) by name 
| search name=indexqueue 
| search psrsvd_sm_current_size_kb &amp;gt; 0 
| eval average=psrsvd_sm_current_size_kb / psrsvd_ct_current_size_kb
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am taking the output of my &lt;CODE&gt;sitimechart&lt;/CODE&gt; and manually recreating the definition of &lt;CODE&gt;average&lt;/CODE&gt; by dividing sum by count.   Then we'll compare it to basically the same data in&lt;CODE&gt;timechart&lt;/CODE&gt;.&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5232i375D23A944D95F57/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Now I'll run a very similar, but not identical, search using just &lt;CODE&gt;timechart&lt;/CODE&gt;.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*metrics.log group=queue name=indexqueue 
| timechart span=1h avg(current_size_kb) by name 
| search indexqueue!=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/5233i8DB62F233EECD54B/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Cool, the exact same averages.   Part of the point here is that my summary index &lt;STRONG&gt;generation&lt;/STRONG&gt; parameters and my summary index &lt;STRONG&gt;usage&lt;/STRONG&gt; parameters can be a little different and the maths still work out to be reasonable.  Like, if I'm collecting CPU usage on an hourly average, then I can report on it with an hourly average, or a daily average, or a weekly average or whatever -- it's just a question of how many different values of "count" and "sum" that I add up in order to compute an average.   (Note this is only true when you roll up to larger time windows - I can't take an hourly sample of average CPU and use that to derive a per-minute average).  This helps you understand why Splunk stores summary index data in this strange prestats serialized format - its more flexible for reporting on later, even if it's not easily human readable.&lt;/P&gt;

&lt;P&gt;While I was writing this, I set up a summary index to run as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*metrics.log group=queue 
| sitimechart span=1m avg(current_size_kb) by name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This is in a scheduled search named "test", scheduled for every hour over the past hour.  If I look at the data in the summary index,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary search_name="test"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I see it's in the prestats format, like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;06/17/2018 12:14:00 -0500, search_name=test, search_now=1529255700.000, info_min_time=1529252100.000, info_max_time=1529255700.000, info_search_time=1529255700.170, name=udp_queue, psrsvd_ct_current_size_kb=2, psrsvd_gc=2, psrsvd_nc_current_size_kb=2, psrsvd_sm_current_size_kb=0, psrsvd_v=1, psrsvd_vt_current_size_kb=0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Now I can use a "regular timechart" to get data out of the summary and present it in a sane visualization:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary search_name="test" 
| timechart span=1h avg(current_size_kb) by name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Hopefully this helps as a walkthrough of what is happening and lets you figure out where you've got things askew.&lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 17:19:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394256#M3397</guid>
      <dc:creator>dwaddle</dc:creator>
      <dc:date>2018-06-17T17:19:30Z</dc:date>
    </item>
    <item>
      <title>Re: In summary indexing, why does the sitimechart gives different results than the timechart?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394257#M3398</link>
      <description>&lt;P&gt;Thank you for the in-depth explanation!  This is very helpful. I will review and test it out. &lt;/P&gt;</description>
      <pubDate>Sun, 17 Jun 2018 19:12:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394257#M3398</guid>
      <dc:creator>dtrelford</dc:creator>
      <dc:date>2018-06-17T19:12:34Z</dc:date>
    </item>
    <item>
      <title>Re: In summary indexing, why does the sitimechart gives different results than the timechart?</title>
      <link>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394258#M3399</link>
      <description>&lt;P&gt;Tested this morning with no issues. Thanks again!&lt;/P&gt;</description>
      <pubDate>Mon, 18 Jun 2018 12:33:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Knowledge-Management/In-summary-indexing-why-does-the-sitimechart-gives-different/m-p/394258#M3399</guid>
      <dc:creator>dtrelford</dc:creator>
      <dc:date>2018-06-18T12:33:33Z</dc:date>
    </item>
  </channel>
</rss>

