<?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: Unable to use results of Streamstats in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-use-results-of-Streamstats/m-p/65240#M16169</link>
    <description>&lt;P&gt;I tried adding [Duration] INDEXED_VALUE = false to my app's fields.conf, but this didn't work.&lt;/P&gt;</description>
    <pubDate>Wed, 06 Oct 2010 21:21:10 GMT</pubDate>
    <dc:creator>Jason</dc:creator>
    <dc:date>2010-10-06T21:21:10Z</dc:date>
    <item>
      <title>Unable to use results of Streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-use-results-of-Streamstats/m-p/65239#M16168</link>
      <description>&lt;P&gt;I'm dealing with some web logs, and have generated statistics on how long a certain user stayed on a certain page by using the &lt;CODE&gt;streamstats&lt;/CODE&gt; command below:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search ... | streamstats current=t global=f window=2 range(_time) as Dur by User | eval Duration=if(isnull(Dur), 0, if(Dur&amp;gt;1800, 0, Dur)) | stats count by _time, User, Page, Duration | fields - count&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;This shows &lt;CODE&gt;Duration&lt;/CODE&gt;, the amount of time a particular &lt;CODE&gt;User&lt;/CODE&gt; spent on a particular &lt;CODE&gt;Page&lt;/CODE&gt;. (The &lt;CODE&gt;eval&lt;/CODE&gt; ignores times over 30 minutes; they are assumed to be different web sessions).
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Now I am trying to do more things with &lt;CODE&gt;Duration&lt;/CODE&gt;, such as sum it up per page, or make a total amount of time all users spent on all pages. But I am running into the same problem - &lt;B&gt;I can't seem to use the &lt;CODE&gt;Duration&lt;/CODE&gt; field!&lt;/B&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search ... | streamstats current=t global=f window=2 range(_time) as Dur by User | eval Duration=if(isnull(Dur), 0, if(Dur&amp;gt;1800, 0, Dur)) | stats count sum(Duration) by Page&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Gives an error, saying &lt;CODE&gt;Specified field(s) missing from results: Duration&lt;/CODE&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
And when I try to sum up all Durations using &lt;CODE&gt;eventstats&lt;/CODE&gt; so I can make a percentage calculation later,&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;search ... | streamstats current=t global=f window=2 range(_time) as Dur by User | eval Duration=if(isnull(Dur), 0, if(Dur&amp;gt;1800, 0, Dur)) | eventstats sum(Duration) as AllDuration&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;B&gt;The &lt;CODE&gt;AllDuration&lt;/CODE&gt; field doesn't even show up.&lt;/B&gt; What is going wrong here? I thought &lt;CODE&gt;streamstats&lt;/CODE&gt; (especially followed by an &lt;CODE&gt;eval&lt;/CODE&gt;) would definitely create a usable field like any other.
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
&lt;BR /&gt;
Behavior seen on both 4.1.5/Linux64 and 4.1.5/Windows32.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2010 21:19:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-use-results-of-Streamstats/m-p/65239#M16168</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2010-10-06T21:19:31Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use results of Streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-use-results-of-Streamstats/m-p/65240#M16169</link>
      <description>&lt;P&gt;I tried adding [Duration] INDEXED_VALUE = false to my app's fields.conf, but this didn't work.&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2010 21:21:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-use-results-of-Streamstats/m-p/65240#M16169</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2010-10-06T21:21:10Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use results of Streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-use-results-of-Streamstats/m-p/65241#M16170</link>
      <description>&lt;P&gt;Weird.  I'm running 4.1.5 on Linux 32 bit, and I tried a similar search with no issues.  This search worked fine:  &lt;CODE&gt;sourcetype=*ftpd* | streamstats current=t global=f window=2 range(_time) as Dur by pid | eval Duration=if(isnull(Dur), 0, if(Dur&amp;gt;1800, 0, Dur)) | stats count by Duration&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2010 01:16:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-use-results-of-Streamstats/m-p/65241#M16170</guid>
      <dc:creator>Lowell</dc:creator>
      <dc:date>2010-10-07T01:16:11Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use results of Streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-use-results-of-Streamstats/m-p/65242#M16171</link>
      <description>&lt;P&gt;Yes, &lt;CODE&gt;stats count by Duration, fields&lt;/CODE&gt; is the only thing that works. &lt;CODE&gt;stats sum(Duration) by fields&lt;/CODE&gt; fails, as does &lt;CODE&gt;| eventstats sum(Duration) as Total | stats count by Total, fields&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2010 01:23:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-use-results-of-Streamstats/m-p/65242#M16171</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2010-10-07T01:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Unable to use results of Streamstats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Unable-to-use-results-of-Streamstats/m-p/65243#M16172</link>
      <description>&lt;P&gt;Turns out it was weird because I was running stuff on a summary index that had been populated by &lt;CODE&gt;sistats&lt;/CODE&gt;. &lt;/P&gt;

&lt;P&gt;I thought you had to populate a summary index with sistats, but it turns out that's only if you plan to do the exact &lt;CODE&gt;stats&lt;/CODE&gt; query when looking at the summary index. My workaround was to use the &lt;CODE&gt;fields Duration, fields..&lt;/CODE&gt; to kick out some prsrvd_* fields that were messing with the functionality of stats.&lt;/P&gt;</description>
      <pubDate>Thu, 07 Oct 2010 04:52:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Unable-to-use-results-of-Streamstats/m-p/65243#M16172</guid>
      <dc:creator>Jason</dc:creator>
      <dc:date>2010-10-07T04:52:35Z</dc:date>
    </item>
  </channel>
</rss>

