<?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: How to filter streamstats results for two equal variables? in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-filter-streamstats-results-for-two-equal-variables/m-p/363822#M1050</link>
    <description>&lt;P&gt;As others have indicated, the combined solution should be replacing your last line with something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | where (error_count&amp;gt;0 AND qualify_count&amp;gt;0 AND patient_count&amp;gt;0) OR (error_count=qualify_count)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 12 May 2017 05:52:54 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-05-12T05:52:54Z</dc:date>
    <item>
      <title>How to filter streamstats results for two equal variables?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-filter-streamstats-results-for-two-equal-variables/m-p/363819#M1047</link>
      <description>&lt;P&gt;My search code is as follows:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="logs" host=tcr2
"Transitioned to Error State" OR "BeamResult Received" OR "scanning controller went to error" OR "session is closed" OR "BeamContext:" 
| dedup description consecutive=true
| reverse
| streamstats count(eval(searchmatch("BeamContext:"))) AS SessionID
| stats count(eval(searchmatch("Transitioned to Error State"))) AS error_count count(eval(searchmatch("scanning controller went to error"))) AS qualify_count count(eval(searchmatch("patientId"))) AS patient_count list(_raw) AS _raw BY SessionID
| search error_count&amp;gt;0 qualify_count&amp;gt;0 patient_count&amp;gt;0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Notice the last line. What I want is to be able to search for &lt;STRONG&gt;error_count=qualify_count&lt;/STRONG&gt; as well. But when I do this, I get zero results even though I know for sure that there are such scenarios. I only want the results of streamstats for a given "SessionID" in which the number for "error_count" is equal to the number for "qualify_count". Any ideas?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:57:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-filter-streamstats-results-for-two-equal-variables/m-p/363819#M1047</guid>
      <dc:creator>like2splunk</dc:creator>
      <dc:date>2020-09-29T13:57:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter streamstats results for two equal variables?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-filter-streamstats-results-for-two-equal-variables/m-p/363820#M1048</link>
      <description>&lt;P&gt;Since you're dealing in numbers, use the &lt;CODE&gt;where&lt;/CODE&gt; command instead of &lt;CODE&gt;search&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 04 May 2017 21:24:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-filter-streamstats-results-for-two-equal-variables/m-p/363820#M1048</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-04T21:24:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter streamstats results for two equal variables?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-filter-streamstats-results-for-two-equal-variables/m-p/363821#M1049</link>
      <description>&lt;P&gt;If you're just trying to find where error_count is equal to qualify_count and patient_count is greater than 0, this snippet that incorporates somesoni2's comment above should work:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| where error_count=qualify_count AND patient_count&amp;gt;0
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:57:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-filter-streamstats-results-for-two-equal-variables/m-p/363821#M1049</guid>
      <dc:creator>Drahgkar</dc:creator>
      <dc:date>2020-09-29T13:57:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to filter streamstats results for two equal variables?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-filter-streamstats-results-for-two-equal-variables/m-p/363822#M1050</link>
      <description>&lt;P&gt;As others have indicated, the combined solution should be replacing your last line with something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | where (error_count&amp;gt;0 AND qualify_count&amp;gt;0 AND patient_count&amp;gt;0) OR (error_count=qualify_count)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 May 2017 05:52:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-filter-streamstats-results-for-two-equal-variables/m-p/363822#M1050</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-12T05:52:54Z</dc:date>
    </item>
  </channel>
</rss>

