<?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 exclude null field values from search results? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242812#M72242</link>
    <description>&lt;P&gt;So a few further questions for clarification -&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Can savedsearch_name appear more than twice?&lt;/LI&gt;
&lt;LI&gt;Can both savedsearch_names be empty?&lt;/LI&gt;
&lt;LI&gt;Are the only events you want exclude are match on first and nothing on second? ( So nothing on first and match on second is allowed )&lt;/LI&gt;
&lt;/UL&gt;</description>
    <pubDate>Tue, 11 Oct 2016 19:52:59 GMT</pubDate>
    <dc:creator>msivill_splunk</dc:creator>
    <dc:date>2016-10-11T19:52:59Z</dc:date>
    <item>
      <title>How to exclude null field values from search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242811#M72241</link>
      <description>&lt;P&gt;Below are the log events I have, where one event has two &lt;CODE&gt;savedsearch_name&lt;/CODE&gt; fields with two values &lt;CODE&gt;"Apache_Monitor"&lt;/CODE&gt; and other is &lt;CODE&gt;""&lt;/CODE&gt; empty. &lt;BR /&gt;
And other event has only one &lt;CODE&gt;savedsearch_name&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Audit:[timestamp=xx-xx-xxxx xx:xx:xx.xxx, id=xxxxx, user=admin, action=search, info=granted , search_id='xxxxxxxx',  index=summary `savedsearch_name`="Apache_Monitor"', enable_lookups='1', extra_fields='*', `savedsearch_name`=""]

Audit:[timestamp=xx-xx-xxxx xx:xx:xx.xxx, id=xxxxx, user=admin, action=search, info=granted , search_id='xxxxxxxx',  index=summary `savedsearch_name`="Apache_Monitor"']
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I want to look only for one field one value (2nd event). So I tried to use NOT condition to get rid of two same field events (1st event)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit action="search" (savedsearch_name="Apache_Monitor") NOT (savedsearch_name="")  search=* NOT "typeahead" NOT metadata NOT "|history" NOT "AUTOSUMMARY"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But It doesn't work, How to exclude the events which has no value ?&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 19:27:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242811#M72241</guid>
      <dc:creator>ibob0304</dc:creator>
      <dc:date>2016-10-11T19:27:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude null field values from search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242812#M72242</link>
      <description>&lt;P&gt;So a few further questions for clarification -&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;Can savedsearch_name appear more than twice?&lt;/LI&gt;
&lt;LI&gt;Can both savedsearch_names be empty?&lt;/LI&gt;
&lt;LI&gt;Are the only events you want exclude are match on first and nothing on second? ( So nothing on first and match on second is allowed )&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 11 Oct 2016 19:52:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242812#M72242</guid>
      <dc:creator>msivill_splunk</dc:creator>
      <dc:date>2016-10-11T19:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude null field values from search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242813#M72243</link>
      <description>&lt;UL&gt;
&lt;LI&gt;no&lt;/LI&gt;
&lt;LI&gt;no&lt;/LI&gt;
&lt;LI&gt;yes&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Tue, 11 Oct 2016 20:05:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242813#M72243</guid>
      <dc:creator>ibob0304</dc:creator>
      <dc:date>2016-10-11T20:05:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude null field values from search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242814#M72244</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit action="search" (savedsearch_name="Apache_Monitor") NOT ("savedsearch_name*savedsearch_name")  search=* NOT "typeahead" NOT metadata NOT "|history" NOT "AUTOSUMMARY"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;STRONG&gt;Updated&lt;/STRONG&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_audit action="search" (savedsearch_name="Apache_Monitor")  search=* NOT "typeahead" NOT metadata NOT "|history" NOT "AUTOSUMMARY" | rex max_match=2 "(?&amp;lt;noOfSavedSearch&amp;gt;savedsearch_name)" | where mvcount(noOfSavedSearch)=1
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 11 Oct 2016 20:07:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242814#M72244</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-11T20:07:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude null field values from search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242815#M72245</link>
      <description>&lt;P&gt;So the following will work and/or provide pointers how to do this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="462049" 
| rex field=_raw ".*`savedsearch_name`.*`savedsearch_name`=\"(?&amp;lt;savedsearch_name_second&amp;gt;)\".*" 
| eval savedsearch_name_second_is_blank=if(savedsearch_name_second="",1,0) 
| where savedsearch_name_second_is_blank = 0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;So the trick is to use regex to find a second savedsearch_name by looking directly against the _raw event field. Then apply additional logic against this field.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 20:09:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242815#M72245</guid>
      <dc:creator>msivill_splunk</dc:creator>
      <dc:date>2016-10-11T20:09:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude null field values from search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242816#M72246</link>
      <description>&lt;P&gt;Still I am seeing two same fields in one event. Is it not possible to eliminate the events which has two same field ? &lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 20:34:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242816#M72246</guid>
      <dc:creator>ibob0304</dc:creator>
      <dc:date>2016-10-11T20:34:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude null field values from search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242817#M72247</link>
      <description>&lt;P&gt;Give the updated answer a try.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 20:45:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242817#M72247</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-10-11T20:45:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to exclude null field values from search results?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242818#M72248</link>
      <description>&lt;P&gt;Updated one works perfectly, you successfully removed the two same field events. thanks&lt;/P&gt;</description>
      <pubDate>Tue, 11 Oct 2016 20:50:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-exclude-null-field-values-from-search-results/m-p/242818#M72248</guid>
      <dc:creator>ibob0304</dc:creator>
      <dc:date>2016-10-11T20:50:50Z</dc:date>
    </item>
  </channel>
</rss>

