<?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: Pivot and Stats and disappearing make my data disappear in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Pivot-and-Stats-and-disappearing-make-my-data-disappear/m-p/166570#M47426</link>
    <description>&lt;P&gt;There is some sort of interaction from the pivots "sort 100" and that last stats command. Putting sort 0 will fix it but someone with a better understanding of the search pipeline can hopefully explain what is occurring.&lt;/P&gt;</description>
    <pubDate>Fri, 01 Aug 2014 01:24:09 GMT</pubDate>
    <dc:creator>Lucas_K</dc:creator>
    <dc:date>2014-08-01T01:24:09Z</dc:date>
    <item>
      <title>Pivot and Stats and disappearing make my data disappear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pivot-and-Stats-and-disappearing-make-my-data-disappear/m-p/166569#M47425</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;

&lt;P&gt;I'm playing around with data models at the moment and I came across this strange issue.  This is similar to my query&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Base search&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| pivot Data_Model Outbound max(value) AS "value" SPLITROW hostname AS "hostname" SPLITROW _time AS "_time" PERIOD minute SPLITROW group AS "group" SPLITROW metric AS "metric" FILTER metric is *myfilter* SORT 100 hostname
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Post Process&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|   streamstats current=t global=f window=2 earliest(value) as curr, latest(value) as next, earliest(_time) as currTime, latest(_time) as nextTime by hostname, metric, group 
| eval timeDiff=nextTime-currTime | eval curr=if(timeDiff&amp;gt;600,NULL,curr)
| eval curr=if(next&amp;lt;curr, NULL, curr)
| eval delta=next-curr
| eval Gigabits=(delta*8/1000/1000/1000)
| eval Gigabits=if(Gigabits &amp;gt; 10000, NULL, Gigabits) 
| eval Gigabits_per_second=Gigabits/timeDiff 
| stats max(Gigabits_per_second) by group
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So there seems to be a problem with using the stats command in this way.  Everytime I run it, I initially get 5 rows returned, but as the search progresses, the search rows drop.  So, I'll start with 10 rows, and then it will drop to 5 rows, and by the end of the search, I will only have 1 row.&lt;/P&gt;

&lt;P&gt;Replacing the stats command with a &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;table Gigabits_per_second, group
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm thought the problem might be with the streamstats command but as I can get the correct values when using a table command, seems to rule that out.  Anyone seen this issue before? &lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;Steve&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2014 01:21:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pivot-and-Stats-and-disappearing-make-my-data-disappear/m-p/166569#M47425</guid>
      <dc:creator>stephenho</dc:creator>
      <dc:date>2014-08-01T01:21:31Z</dc:date>
    </item>
    <item>
      <title>Re: Pivot and Stats and disappearing make my data disappear</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Pivot-and-Stats-and-disappearing-make-my-data-disappear/m-p/166570#M47426</link>
      <description>&lt;P&gt;There is some sort of interaction from the pivots "sort 100" and that last stats command. Putting sort 0 will fix it but someone with a better understanding of the search pipeline can hopefully explain what is occurring.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Aug 2014 01:24:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Pivot-and-Stats-and-disappearing-make-my-data-disappear/m-p/166570#M47426</guid>
      <dc:creator>Lucas_K</dc:creator>
      <dc:date>2014-08-01T01:24:09Z</dc:date>
    </item>
  </channel>
</rss>

