<?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 can we exclude rows which are present in another table/lookup ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353677#M104668</link>
    <description>&lt;P&gt;@somesoni2: thank you !! my base search(tstats) display results in table. Not sure how to use  "NOT" after that.&lt;/P&gt;</description>
    <pubDate>Thu, 01 Feb 2018 20:20:37 GMT</pubDate>
    <dc:creator>AKG1_old1</dc:creator>
    <dc:date>2018-02-01T20:20:37Z</dc:date>
    <item>
      <title>How can we exclude rows which are present in another table/lookup ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353673#M104664</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I am using one search query to extract list of data and I want to exclude those rows  which are present in one csv file(lookup).&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4292iBC708103FBCB6E25/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4293i143EFDC9FF447E2B/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 18:52:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353673#M104664</guid>
      <dc:creator>AKG1_old1</dc:creator>
      <dc:date>2018-02-01T18:52:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can we exclude rows which are present in another table/lookup ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353674#M104665</link>
      <description>&lt;P&gt;@agoyal, refer to @somesoni2's answer &lt;A href="https://answers.splunk.com/answers/612603/how-to-search-what-values-are-missing-in-my-lookup.html"&gt;https://answers.splunk.com/answers/612603/how-to-search-what-values-are-missing-in-my-lookup.html&lt;/A&gt; of marking the results coming from index vs lookup and then you can add a filter to only those coming from index.&lt;/P&gt;

&lt;P&gt;Following is a run anywhere example (instead of first pipe &lt;CODE&gt;| tstats&lt;/CODE&gt; you can have your first search pulling data from index)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| tstats count where index=_internal by sourcetype
| eval from="data"
| append[ | inputlookup sourcetypelist.csv 
    | table sourcetype
    | eval count=0 
    | eval from="lookup"]
| stats values(from) as from sum(count) as Total by sourcetype
| search from="data" AND from!="lookup"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also use &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Join#Optional_arguments"&gt;outer join (or left)&lt;/A&gt;  with &lt;CODE&gt;|inputlookup&lt;/CODE&gt; as your first command and &lt;CODE&gt;index search&lt;/CODE&gt; as second.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 19:07:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353674#M104665</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-02-01T19:07:29Z</dc:date>
    </item>
    <item>
      <title>Re: How can we exclude rows which are present in another table/lookup ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353675#M104666</link>
      <description>&lt;P&gt;Generally, in this type of cases, you can just use lookup table to filter your data upfront, so that all you get is data no in lookup, like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search NOT [| inputlookup yourlookup.csv | table Fields For Filter]
|..aggregation commans...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 01 Feb 2018 19:13:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353675#M104666</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-02-01T19:13:47Z</dc:date>
    </item>
    <item>
      <title>Re: How can we exclude rows which are present in another table/lookup ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353676#M104667</link>
      <description>&lt;P&gt;Thank you @niketnilay  @somesoni2 . It worked for me. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 20:17:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353676#M104667</guid>
      <dc:creator>AKG1_old1</dc:creator>
      <dc:date>2018-02-01T20:17:58Z</dc:date>
    </item>
    <item>
      <title>Re: How can we exclude rows which are present in another table/lookup ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353677#M104668</link>
      <description>&lt;P&gt;@somesoni2: thank you !! my base search(tstats) display results in table. Not sure how to use  "NOT" after that.&lt;/P&gt;</description>
      <pubDate>Thu, 01 Feb 2018 20:20:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353677#M104668</guid>
      <dc:creator>AKG1_old1</dc:creator>
      <dc:date>2018-02-01T20:20:37Z</dc:date>
    </item>
    <item>
      <title>Re: How can we exclude rows which are present in another table/lookup ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353678#M104669</link>
      <description>&lt;P&gt;@agoyal , by base search @somesoni2 meant the first pipe with index and sourcetype where you will apply &lt;BR /&gt;
 second search for field values not in the lookup file i.e.  &lt;CODE&gt;NOT [| inputlookup ....]&lt;/CODE&gt;&lt;BR /&gt;
Unless your main search is on metadata fields, this is better approach where your events can be filtered in the base search itself. So do try out this approach (if your main query is not tstats) and confirm query performance.&lt;/P&gt;

&lt;P&gt;PS: Table generating command or transforming commands can be placed only after your base search.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 01:25:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353678#M104669</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-02-02T01:25:32Z</dc:date>
    </item>
    <item>
      <title>Re: How can we exclude rows which are present in another table/lookup ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353679#M104670</link>
      <description>&lt;P&gt;Thank you for clarification. my main query is tstats. Other approach with append fits for my requirement. Thanks Again &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Feb 2018 15:10:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-we-exclude-rows-which-are-present-in-another-table/m-p/353679#M104670</guid>
      <dc:creator>AKG1_old1</dc:creator>
      <dc:date>2018-02-02T15:10:55Z</dc:date>
    </item>
  </channel>
</rss>

