<?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 How do I route sistats to a specific index? in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-route-sistats-to-a-specific-index/m-p/450180#M93963</link>
    <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to create a summary index for license information, tracking pool, idx and sourcetype.  I am using the following search, which will run daily, overnight.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal  source=*license_usage.log* type="Usage" | eval h=if(len(h)=0 OR isnull(h),"(SQUASHED)",h) | eval s=if(len(s)=0 OR isnull(s),"(SQUASHED)",s) | eval idx=if(len(idx)=0 OR isnull(idx),"(UNKNOWN)",idx) | bin _time span=1d | sistats sum(b) as b by _time, pool,  st, idx
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have two questions, as I've never used sistats before.&lt;BR /&gt;&lt;BR /&gt;
1.  How do I route this to a specific index, as I don't want to use "summary",&lt;BR /&gt;
2.  I get a number of additional fields created - what are they?  &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;psrsvd_ct_b, psrsvd_gc, psrsvd_nc_b, psrsvd_sm_b, psrsvd_v...&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Tue, 29 Sep 2020 21:46:49 GMT</pubDate>
    <dc:creator>a212830</dc:creator>
    <dc:date>2020-09-29T21:46:49Z</dc:date>
    <item>
      <title>How do I route sistats to a specific index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-route-sistats-to-a-specific-index/m-p/450180#M93963</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I want to create a summary index for license information, tracking pool, idx and sourcetype.  I am using the following search, which will run daily, overnight.  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal  source=*license_usage.log* type="Usage" | eval h=if(len(h)=0 OR isnull(h),"(SQUASHED)",h) | eval s=if(len(s)=0 OR isnull(s),"(SQUASHED)",s) | eval idx=if(len(idx)=0 OR isnull(idx),"(UNKNOWN)",idx) | bin _time span=1d | sistats sum(b) as b by _time, pool,  st, idx
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I have two questions, as I've never used sistats before.&lt;BR /&gt;&lt;BR /&gt;
1.  How do I route this to a specific index, as I don't want to use "summary",&lt;BR /&gt;
2.  I get a number of additional fields created - what are they?  &lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;psrsvd_ct_b, psrsvd_gc, psrsvd_nc_b, psrsvd_sm_b, psrsvd_v...&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 29 Sep 2020 21:46:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-route-sistats-to-a-specific-index/m-p/450180#M93963</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2020-09-29T21:46:49Z</dc:date>
    </item>
    <item>
      <title>Re: How do I route sistats to a specific index?</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/How-do-I-route-sistats-to-a-specific-index/m-p/450181#M93964</link>
      <description>&lt;P&gt;Hey buddy - So think of the sistats command like what the indexers send to the SH. That helped me wrap my brain around it at first.&lt;/P&gt;

&lt;P&gt;Given our history, I know I can tease you a little here: sounds like someone didn't read the manual &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;When using Summary Indexing, there's a &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Usesummaryindexing#Set_up_summary_index_searches_in_Splunk_Web"&gt;UI friendly way of managing&lt;/A&gt; the target index and such. Similarly, the fields added are explained in a topic that couldn't be more spot on to what you're looking for: &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/Knowledge/Usesummaryindexing#Fields_added_to_summary-indexed_data_by_the_si-_summary_indexing_commands"&gt;Fields added to summary-indexed data by the si- summary indexing commands&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Now, cause I have so much love for you, I'll share a bit more here. It helped me a lot, when I was learning about summary indexing, to play with the &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Collect"&gt;Collect&lt;/A&gt; command. That's essentially the command that does the real summary indexing that the UI adds for ya. But playing with that command directly, along with the &lt;CODE&gt;run_in_preview&lt;/CODE&gt; option, allowed me to learn rapidly rather than waiting for my scheduled search to populate the summary indexing.&lt;/P&gt;

&lt;P&gt;Another thing that helped me may be counter intuitive. As a way to validate my summary indexing, I would run my summary indexing search with extra commands after that represented how i wanted to use that summary indexing data. So in your example, that might be: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal source=*license_usage.log* type="Usage" 
| eval h=if(len(h)=0 OR isnull(h),"(SQUASHED)",h) 
| eval s=if(len(s)=0 OR isnull(s),"(SQUASHED)",s) 
| eval idx=if(len(idx)=0 OR isnull(idx),"(UNKNOWN)",idx) 
| bin _time span=1d 
| sistats sum(b) as b by _time, pool, st, idx
| stats sum(b) as b by _time, pool, st, idx
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Notice how my &lt;CODE&gt;stats&lt;/CODE&gt; command essentially is the same as the &lt;CODE&gt;sistats&lt;/CODE&gt;? That's how I would validate it's what I wanted.&lt;/P&gt;

&lt;P&gt;And while we're here, might I suggest the following adjustments to your search string:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal sourcetype=splunkd source=*license_usage.log* type="Usage" 
| foreach h s idx 
    [ eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;=if(len(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;)=0 OR isnull(&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;),"(SQUASHED)",&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;) ]
| bin span=1d _time
| sistats sum(b) BY _time, pool, st, idx
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Notice the addition of sourcetype to the base, switch to foreach, and removal of "as b" to the sistats (not needed for si* commands).&lt;/P&gt;

&lt;P&gt;Ok, stopping there. Let us know what you think! Good to hear from you!&lt;/P&gt;</description>
      <pubDate>Thu, 01 Nov 2018 14:58:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/How-do-I-route-sistats-to-a-specific-index/m-p/450181#M93964</guid>
      <dc:creator>sloshburch</dc:creator>
      <dc:date>2018-11-01T14:58:20Z</dc:date>
    </item>
  </channel>
</rss>

