<?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: Filter results based on aggregates (Another question of Splunk's way to emulate SQL's &amp;quot;HAVING&amp;quot; ) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Filter-results-based-on-aggregates-Another-question-of-Splunk-s/m-p/497813#M138672</link>
    <description>&lt;P&gt;the &lt;CODE&gt;pertnerId&lt;/CODE&gt; of your results is only &lt;EM&gt;ADP&lt;/EM&gt;?&lt;/P&gt;</description>
    <pubDate>Sat, 16 May 2020 00:54:02 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-05-16T00:54:02Z</dc:date>
    <item>
      <title>Filter results based on aggregates (Another question of Splunk's way to emulate SQL's "HAVING" )</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-results-based-on-aggregates-Another-question-of-Splunk-s/m-p/497809#M138668</link>
      <description>&lt;P&gt;My goal is to design an alert that will populate a table of raw results, but only when certain evaluation aggregates apply. For example, if the total count of events in a time frame &amp;gt;100, post table of raw data. How do I achieve this limitation (similar to SQL "Having"), while reserving my desired table output?&lt;/P&gt;

&lt;P&gt;My query so far, which reflects the table output I desire without the "Having" logic:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; splunk_server=indexer* index=wsi sourcetype=fdpwsiperf (channel_type=ofx2 OR agent_service=OfxAgent) domain=tax 
 api_version=v1 capability=* tax_year=2019 partnerId!=*test* partnerId="ADP"
 | lookup Provider_Alert.csv Provider_ID AS partnerId OUTPUT Tier Form_Type
 | search Tier=Tier1
 | eval capability=if(like(capability,"109%"),"1099",'capability')
 | eval error_category=case(like(http_status_code_host,"5%"), "5XX", like(http_status_code_host,"4%"),"4XX", http_error_host="Read 
 timed out", 'http_error_host', 1==1, "Other")
 | table _time, partnerId, intuit_tid, error_category, capability, tax_year, ofx_appid, host_base_url
 | rename intuit_tid as TRNUID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Do not direct me to "From SQL to Splunk SPL" documentation. I've reviewed it, and it's not helpful for my use case.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 20:24:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-results-based-on-aggregates-Another-question-of-Splunk-s/m-p/497809#M138668</guid>
      <dc:creator>hollybross1219</dc:creator>
      <dc:date>2020-05-15T20:24:44Z</dc:date>
    </item>
    <item>
      <title>Re: Filter results based on aggregates (Another question of Splunk's way to emulate SQL's "HAVING" )</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-results-based-on-aggregates-Another-question-of-Splunk-s/m-p/497810#M138669</link>
      <description>&lt;P&gt;This question is confusing.  The title says "limit results", but the body says "count &amp;gt; 100" (the opposite of limit).  Which is desired?&lt;BR /&gt;
Where in the example query would a limit/count be applied?&lt;BR /&gt;
Is the idea to display/hide the table based on the number of results?&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 21:07:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-results-based-on-aggregates-Another-question-of-Splunk-s/m-p/497810#M138669</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-05-15T21:07:44Z</dc:date>
    </item>
    <item>
      <title>Re: Filter results based on aggregates (Another question of Splunk's way to emulate SQL's "HAVING" )</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-results-based-on-aggregates-Another-question-of-Splunk-s/m-p/497811#M138670</link>
      <description>&lt;P&gt;@richgalloway -- I totally see how that's confusing. Apologies. It's a complex question and it's hard to describe.&lt;/P&gt;

&lt;P&gt;I want a solution that outputs raw data in a table... but will only do so if the aggregations of that raw data meet certain criteria (ie. "if total count is more than 10, spit out raw data")&lt;/P&gt;</description>
      <pubDate>Fri, 15 May 2020 21:23:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-results-based-on-aggregates-Another-question-of-Splunk-s/m-p/497811#M138670</guid>
      <dc:creator>hollybross1219</dc:creator>
      <dc:date>2020-05-15T21:23:17Z</dc:date>
    </item>
    <item>
      <title>Re: Filter results based on aggregates (Another question of Splunk's way to emulate SQL's "HAVING" )</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-results-based-on-aggregates-Another-question-of-Splunk-s/m-p/497812#M138671</link>
      <description>&lt;P&gt;I found a work-around with the sub-search in the beginning... but I am open to more graceful and creative ways of doing this... as this is incredibly clunky&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;splunk_server=indexer* index=wsi sourcetype=fdpwsiperf (channel_type=ofx2 OR agent_service=OfxAgent) domain=tax 
api_version=v1 capability=* tax_year=2019 partnerId!=*test* 
    [search splunk_server=indexer* index=wsi sourcetype=fdpwsiperf (channel_type=ofx2 OR agent_service=OfxAgent) domain=tax 
api_version=v1 capability=* tax_year=2019 partnerId!=*test* partnerId=*
     | lookup Provider_Alert.csv Provider_ID AS partnerId OUTPUT Tier Form_Type 
    | search Tier=Tier1 
    | eval error_category=case(like(http_status_code_host,"5%"), "5XX", like(http_status_code_host,"4%"),"4XX", 
http_error_host=timeout_event, 'http_error_host', 1==1, "Other") 
     | chart dc(intuit_tid) OVER partnerId by error_category 
    | addtotals fieldname="total_events" 
    | eval error_rate=round(((total_events-Other)/total_events)*100,2) 
    | where total_events &amp;gt;= 25 AND error_rate &amp;gt;= 40 
    | fields partnerId] 
| lookup Provider_Alert.csv Provider_ID AS partnerId OUTPUT Tier Form_Type 
| search Tier=Tier1 
| eval capability=if(like(capability,"109%"),"1099",'capability') 
| eval error_category=case(like(http_status_code_host,"5%"), "5XX", like(http_status_code_host,"4%"),"4XX", http_error_host="Read 
timed out", 'http_error_host', 1==1, "Other") 
| where error_category!="Other"
| table _time, partnerId, intuit_tid, error_category, capability, tax_year, ofx_appid, host_base_url 
| sort 10 - _time
| rename intuit_tid as TRNUID
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 15 May 2020 21:26:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-results-based-on-aggregates-Another-question-of-Splunk-s/m-p/497812#M138671</guid>
      <dc:creator>hollybross1219</dc:creator>
      <dc:date>2020-05-15T21:26:31Z</dc:date>
    </item>
    <item>
      <title>Re: Filter results based on aggregates (Another question of Splunk's way to emulate SQL's "HAVING" )</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-results-based-on-aggregates-Another-question-of-Splunk-s/m-p/497813#M138672</link>
      <description>&lt;P&gt;the &lt;CODE&gt;pertnerId&lt;/CODE&gt; of your results is only &lt;EM&gt;ADP&lt;/EM&gt;?&lt;/P&gt;</description>
      <pubDate>Sat, 16 May 2020 00:54:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-results-based-on-aggregates-Another-question-of-Splunk-s/m-p/497813#M138672</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-05-16T00:54:02Z</dc:date>
    </item>
    <item>
      <title>Re: Filter results based on aggregates (Another question of Splunk's way to emulate SQL's "HAVING" )</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Filter-results-based-on-aggregates-Another-question-of-Splunk-s/m-p/497814#M138673</link>
      <description>&lt;P&gt;@to4kawa -- sorry, that was just a test case against that partner. The result of that subsearch can be any partner where the &lt;CODE&gt;where&lt;/CODE&gt; condition applies&lt;/P&gt;</description>
      <pubDate>Wed, 20 May 2020 18:33:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Filter-results-based-on-aggregates-Another-question-of-Splunk-s/m-p/497814#M138673</guid>
      <dc:creator>hollybross1219</dc:creator>
      <dc:date>2020-05-20T18:33:37Z</dc:date>
    </item>
  </channel>
</rss>

