<?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 use aggregates to filter data and join the result to another search? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-aggregates-to-filter-data-and-join-the-result-to/m-p/691700#M235503</link>
    <description>&lt;P&gt;I wonder if an outer join might have worked, but join is rarely the best answer because it performs poorly.&lt;/P&gt;&lt;P&gt;One other approach is to use a subsearch to find the interesting transaction IDs and then search for those IDs.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="data" [search index="data" 
  | stats values(eventtype) as eventtype by transaction_id
  | search eventtype="TYPE1" AND eventtype="TYPE2" 
  | fields transaction_id
  | format ]
| table *&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 26 Jun 2024 15:14:28 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2024-06-26T15:14:28Z</dc:date>
    <item>
      <title>How to use aggregates to filter data and join the result to another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-aggregates-to-filter-data-and-join-the-result-to/m-p/691660#M235497</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have an index with events, where events belong to a transaction (transaction_id). I am interested in transactions which contain exact two event with specific eventtype (type1 and type2).&lt;/P&gt;&lt;P&gt;When I have all the transaction(_ids) which contain those two eventtypes, I want to join to the events again to get those complete transactions, including all their events.&lt;/P&gt;&lt;P&gt;There might be events with other eventtypes as well which need to be retrieved.&lt;/P&gt;&lt;P&gt;This is what I tried:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="data" 
| stats values(eventtype) as eventtype by transaction_id
| search eventtype="TYPE1" AND eventtype="TYPE2" 
| table transaction_id
| join type=inner transaction_id[search index="data"]
| table *&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But this query returns only a fraction of the available matching transactions.&lt;/P&gt;&lt;P&gt;I read some other posts with all kind of approaches, is it really so hard in Splunk to get such tasks done?&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 13:19:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-aggregates-to-filter-data-and-join-the-result-to/m-p/691660#M235497</guid>
      <dc:creator>cjoelly</dc:creator>
      <dc:date>2024-06-26T13:19:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to use aggregates to filter data and join the result to another search?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-aggregates-to-filter-data-and-join-the-result-to/m-p/691700#M235503</link>
      <description>&lt;P&gt;I wonder if an outer join might have worked, but join is rarely the best answer because it performs poorly.&lt;/P&gt;&lt;P&gt;One other approach is to use a subsearch to find the interesting transaction IDs and then search for those IDs.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="data" [search index="data" 
  | stats values(eventtype) as eventtype by transaction_id
  | search eventtype="TYPE1" AND eventtype="TYPE2" 
  | fields transaction_id
  | format ]
| table *&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jun 2024 15:14:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-aggregates-to-filter-data-and-join-the-result-to/m-p/691700#M235503</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2024-06-26T15:14:28Z</dc:date>
    </item>
  </channel>
</rss>

