<?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 aggregate results based on a set of values in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-aggregate-results-based-on-a-set-of-values/m-p/481168#M134833</link>
    <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;Why you don't use the IN to filter request:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal name IN ("management","ingest")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in your case:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=someIndex "attr1"=aConstant attr2="aValue" filterCriteria="Criteria1" | table _time, resultValue1, resultValue2, resultValue3 | sort _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Thu, 09 Jan 2020 16:09:01 GMT</pubDate>
    <dc:creator>TISKAR</dc:creator>
    <dc:date>2020-01-09T16:09:01Z</dc:date>
    <item>
      <title>How to aggregate results based on a set of values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-aggregate-results-based-on-a-set-of-values/m-p/481166#M134831</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;I have the following query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=someIndex "attr1"=aConstant attr2="aValue" filterCriteria="Criteria1" | table _time, resultValue1, resultValue2, resultValue3 | sort _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Quick explanation of the fields:&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;attr1/2: these are some filters which have constants. Those are "irrelevant" to my problem right now.&lt;/LI&gt;
&lt;LI&gt;filterCriteria: The above query has one value as a filter, but I need to filter by two values. This means something like &lt;CODE&gt;filterCriteria in("Criteria1", "Criteria2")&lt;/CODE&gt;.&lt;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;For achieving this, I tried to use &lt;CODE&gt;join&lt;/CODE&gt; of two separate queries, based on the &lt;CODE&gt;filterCriteria&lt;/CODE&gt; attribute, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=someIndex "attr1"=aConstant attr2="aValue" filterCriteria="Criteria1" | join filterCriteria [search index=someIndex "attr1"=aConstant attr2="aValue" filterCriteria="Criteria2"] | table _time, resultValue1, resultValue2, resultValue3 | sort _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But it seems that it's returning only the values of the last part of the join instead.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;resultValue1/2/3&lt;/CODE&gt; are fields with values shared by both queries, so they can be aggregated.&lt;/P&gt;

&lt;P&gt;Is there a most efficient/another way to achieve this filtering by multivalued / &lt;CODE&gt;in&lt;/CODE&gt;-like criteria?&lt;/P&gt;

&lt;P&gt;Thanks in advance! &lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 13:57:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-aggregate-results-based-on-a-set-of-values/m-p/481166#M134831</guid>
      <dc:creator>alejandrome</dc:creator>
      <dc:date>2020-01-09T13:57:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to aggregate results based on a set of values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-aggregate-results-based-on-a-set-of-values/m-p/481167#M134832</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;(index=someIndex "attr1"=aConstant attr2="aValue" filterCriteria="Criteria1" ) OR (index=someIndex "attr1"=aConstant attr2="aValue" filterCriteria="Criteria2" ) 
| stats values(_time) as _time , values(resultValue1) as resultValues1, values(resultValue2) as resultValues2, values(resultValue3) as resultValues3 by filterCriteria 
| sort _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;try &lt;CODE&gt;stats&lt;/CODE&gt; with &lt;EM&gt;by&lt;/EM&gt; .&lt;/P&gt;</description>
      <pubDate>Thu, 09 Jan 2020 14:47:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-aggregate-results-based-on-a-set-of-values/m-p/481167#M134832</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-01-09T14:47:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to aggregate results based on a set of values</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-aggregate-results-based-on-a-set-of-values/m-p/481168#M134833</link>
      <description>&lt;P&gt;Hello, &lt;/P&gt;

&lt;P&gt;Why you don't use the IN to filter request:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal name IN ("management","ingest")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;in your case:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=someIndex "attr1"=aConstant attr2="aValue" filterCriteria="Criteria1" | table _time, resultValue1, resultValue2, resultValue3 | sort _time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 09 Jan 2020 16:09:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-aggregate-results-based-on-a-set-of-values/m-p/481168#M134833</guid>
      <dc:creator>TISKAR</dc:creator>
      <dc:date>2020-01-09T16:09:01Z</dc:date>
    </item>
  </channel>
</rss>

