<?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 suppress search results when a certain condition is met? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401689#M116244</link>
    <description>&lt;P&gt;Thank you!  It is working and I will mark it as answered because it does exactly what I asked.  However, my oversimplification has created a new "problem".  My csv actually has additional columns.  When I run your suggestion, I get the results of the original query but I also get the additional columns from my csv (to the right of the results).  You would not have seen that because you followed my question, this is my fault.  If you add an additional column to your cvs, you should see the same.  Are you aware of an easy way to remove the extra columns?&lt;/P&gt;

&lt;P&gt;Thanks again,&lt;BR /&gt;
Jonathan&lt;/P&gt;</description>
    <pubDate>Tue, 14 Aug 2018 18:08:55 GMT</pubDate>
    <dc:creator>jmoeller</dc:creator>
    <dc:date>2018-08-14T18:08:55Z</dc:date>
    <item>
      <title>How to suppress search results when a certain condition is met?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401687#M116242</link>
      <description>&lt;P&gt;I need help with a very basic search concept.  I need a way to suppress search results if a certain condition is met. I have a CSV file (file.csv) &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Maint
YES
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I need the exact search that would follow this basic logic...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   index=* (whatever the search)  look at file.csv  If Maint="YES" ensure  search returns nothing, otherwise return as normal
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please provide &lt;STRONG&gt;actual working search&lt;/STRONG&gt; (I have tried many ways and I am sure I am missing something small, I am not familiar enough with the searches to fix minor issues)&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 13:28:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401687#M116242</guid>
      <dc:creator>jmoeller</dc:creator>
      <dc:date>2018-08-14T13:28:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress search results when a certain condition is met?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401688#M116243</link>
      <description>&lt;P&gt;@jmoeller,&lt;/P&gt;

&lt;P&gt;Here is what I tried and working&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Created a csv with just column name as Maint and value as Yes&lt;/LI&gt;
&lt;LI&gt;Added the file as a lookup table from &lt;CODE&gt;Lookups » Lookup table files&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;Created a lookup definition from &lt;CODE&gt;Lookups » Lookup definitions » maint&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Executed below search and gives me the result&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal|stats count by sourcetype
| appendcols [| inputlookup maint]
| filldown Maint
&lt;/CODE&gt;&lt;/PRE&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/5538i4B29F645BF6C36F6/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;/LI&gt;
&lt;/OL&gt;

&lt;P&gt;And below no result&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal|stats count by sourcetype
| appendcols [| inputlookup maint]
| filldown Maint
| where Maint!="Yes"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Try if this works for your environment&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 17:21:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401688#M116243</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-08-14T17:21:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress search results when a certain condition is met?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401689#M116244</link>
      <description>&lt;P&gt;Thank you!  It is working and I will mark it as answered because it does exactly what I asked.  However, my oversimplification has created a new "problem".  My csv actually has additional columns.  When I run your suggestion, I get the results of the original query but I also get the additional columns from my csv (to the right of the results).  You would not have seen that because you followed my question, this is my fault.  If you add an additional column to your cvs, you should see the same.  Are you aware of an easy way to remove the extra columns?&lt;/P&gt;

&lt;P&gt;Thanks again,&lt;BR /&gt;
Jonathan&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 18:08:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401689#M116244</guid>
      <dc:creator>jmoeller</dc:creator>
      <dc:date>2018-08-14T18:08:55Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress search results when a certain condition is met?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401690#M116245</link>
      <description>&lt;P&gt;Actually, I spoke too soon.  It works with a query involving statistics but if you remove "| stats count by sourcetype",  you receive and error "Error in appendcols' command.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Aug 2018 18:19:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401690#M116245</guid>
      <dc:creator>jmoeller</dc:creator>
      <dc:date>2018-08-14T18:19:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress search results when a certain condition is met?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401691#M116246</link>
      <description>&lt;P&gt;Hi Jonathan(@jmoeller),&lt;/P&gt;

&lt;P&gt;No worries,you could use append also. I now have three columns in the csv and just selected Maint by using &lt;CODE&gt;fields&lt;/CODE&gt;. Try this and let me know if it works for you as well.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_internal|append [| inputlookup Maint|fields Maint]|reverse|filldown Maint|reverse|where Maint!="Yes"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 15 Aug 2018 03:10:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401691#M116246</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-08-15T03:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress search results when a certain condition is met?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401692#M116247</link>
      <description>&lt;P&gt;Thanks again.  It is working but there is still a minor issue.  When I use the search above, it "appends" a blank event at the bottom of the list.  Since we are using this for alerting, a simplified search would be...&lt;/P&gt;

&lt;P&gt;EventCode=1000&lt;/P&gt;

&lt;P&gt;The alert would trigger if there is a record returned, thus the issue.  &lt;/P&gt;

&lt;P&gt;You should see it if you just modify your example to and index that doesn't exist.  You should see a singe event returned rather than zero.&lt;/P&gt;

&lt;P&gt;Thanks, again for all of your help.  If we can get rid of the extra event, I am golden.&lt;/P&gt;</description>
      <pubDate>Wed, 15 Aug 2018 14:48:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401692#M116247</guid>
      <dc:creator>jmoeller</dc:creator>
      <dc:date>2018-08-15T14:48:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to suppress search results when a certain condition is met?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401693#M116248</link>
      <description>&lt;P&gt;Hi Jonathan(@jmoeller),&lt;/P&gt;

&lt;P&gt;Thanks for highlighting it. You could just filter it out by adding &lt;CODE&gt;|where _raw!=""&lt;/CODE&gt; at the end of the search. Its purely depends on your search results. If you have just events returned , then above should work and if you have some fields displayed , for e.g. table field1,field2 then you could add the condition based on the field also. Let me know how it goes. &lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 16 Aug 2018 03:57:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-suppress-search-results-when-a-certain-condition-is-met/m-p/401693#M116248</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-08-16T03:57:28Z</dc:date>
    </item>
  </channel>
</rss>

