<?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 small table results by large table results in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-small-table-results-by-large-table-results/m-p/630882#M219155</link>
    <description>&lt;P&gt;You should try to avoid join - and in almost all cases, you can with stats.&lt;/P&gt;&lt;P&gt;If you want only failures which have also succeeded, then replace my previous last 2 lines with&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats values(isFailed) as isFailed by orderNumber
| where mvcount(isFailed)=2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;So, this will trigger when you have both a 0 and 1&lt;/P&gt;&lt;P&gt;join has limitations, it's slower and can cause unpredictable results depending on your data volume.&lt;/P&gt;&lt;P&gt;Note also that neither of these will deal with any time ordering of the events. You're looking for 'previous' success, but this will not show you whether the success comes before the failure.&lt;/P&gt;</description>
    <pubDate>Tue, 14 Feb 2023 22:49:21 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-02-14T22:49:21Z</dc:date>
    <item>
      <title>How to filter small table results by large table results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-small-table-results-by-large-table-results/m-p/630697#M219104</link>
      <description>&lt;P class=""&gt;I have two searches that will return orderNumbers&lt;/P&gt;
&lt;P class=""&gt;1.&lt;BR /&gt;index=main "Failed insert" | table orderNumber&lt;BR /&gt;//returns small list&lt;/P&gt;
&lt;P class=""&gt;2.&lt;BR /&gt;index=main "Successful insert" | table orderNumber&lt;BR /&gt;//returns huge list&lt;/P&gt;
&lt;P class=""&gt;I want a list of "Failed insert" orderNumbers that have NOT had a "Successful insert" previously. How can I use the results of the second search to filter the results of the first search?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 23:25:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-small-table-results-by-large-table-results/m-p/630697#M219104</guid>
      <dc:creator>queriousGeorge</dc:creator>
      <dc:date>2023-02-13T23:25:56Z</dc:date>
    </item>
    <item>
      <title>Re: Filter small table results by large table results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-small-table-results-by-large-table-results/m-p/630719#M219110</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/253842"&gt;@queriousGeorge&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;You can do this is a single search for both data sets and then calculating&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=main "Failed insert" OR "Successful insert"
| eval isFailed=if(match(_raw, "Failed insert"), 1, 0)
| stats min(isFailed) as isFailed by orderNumber
| where isFailed=1&lt;/LI-CODE&gt;&lt;P&gt;so is 'isFailed' is set to 1 if the event is a failed one and then by finding the minimum you can see that any order numbers that have a value 0 have succeeded at least once, where the minimum value of isFailed of 1 indicates a failure with no success.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Feb 2023 22:30:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-small-table-results-by-large-table-results/m-p/630719#M219110</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-13T22:30:21Z</dc:date>
    </item>
    <item>
      <title>Re: Filter small table results by large table results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-small-table-results-by-large-table-results/m-p/630878#M219154</link>
      <description>&lt;P&gt;This ended up working for me:&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;`index=main "failed insert" | stats count by orderNumber | eval previousSuccess=0 | table orderNumber previousSuccess | join type=left orderNumber [search index=main “successful insert” | eval previousSuccess=1 | table orderNumber previousSuccess] | table orderNumber previousSuccess | where previousSuccess=0`&lt;BR /&gt;&lt;BR /&gt;I needed a count of not only the fails, but the fails with a previous success.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 22:31:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-small-table-results-by-large-table-results/m-p/630878#M219154</guid>
      <dc:creator>queriousGeorge</dc:creator>
      <dc:date>2023-02-14T22:31:31Z</dc:date>
    </item>
    <item>
      <title>Re: Filter small table results by large table results</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-filter-small-table-results-by-large-table-results/m-p/630882#M219155</link>
      <description>&lt;P&gt;You should try to avoid join - and in almost all cases, you can with stats.&lt;/P&gt;&lt;P&gt;If you want only failures which have also succeeded, then replace my previous last 2 lines with&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| stats values(isFailed) as isFailed by orderNumber
| where mvcount(isFailed)=2&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;So, this will trigger when you have both a 0 and 1&lt;/P&gt;&lt;P&gt;join has limitations, it's slower and can cause unpredictable results depending on your data volume.&lt;/P&gt;&lt;P&gt;Note also that neither of these will deal with any time ordering of the events. You're looking for 'previous' success, but this will not show you whether the success comes before the failure.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Feb 2023 22:49:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-filter-small-table-results-by-large-table-results/m-p/630882#M219155</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-14T22:49:21Z</dc:date>
    </item>
  </channel>
</rss>

