<?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: Return events with excluded field value combined with all events that have no value for that field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-return-events-with-excluded-field-value-combined-with/m-p/642929#M222681</link>
    <description>&lt;P&gt;So you want this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;search .... (field!=value OR NOT field=*)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 10 May 2023 22:25:18 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-05-10T22:25:18Z</dc:date>
    <item>
      <title>How can I return events with excluded field value combined with all events that have no value for that field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-return-events-with-excluded-field-value-combined-with/m-p/642856#M222651</link>
      <description>&lt;P&gt;Hello all.&lt;/P&gt;
&lt;P&gt;I've been having some trouble with a tricky query. Essentially, I want to return all events that contain a certain field, with a specific value excluded, and combine that with all events that also contain nothing for that particular field.&lt;/P&gt;
&lt;P&gt;For excluding the field value, I would use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;... field!=value&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;And for all events that do not have a value for that field, I would use:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;... NOT field="*"&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I have no idea how to combine these, as one requires the field and the other completely excludes it. I have tried:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;&amp;lt;search&amp;gt; field!=value
 | fields -field&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;But it doesn't work, as I believe I'm basically applying a filter but doing nothing with it.&lt;BR /&gt;&lt;BR /&gt;Any help will be greatly appreciated! Thank you.&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 02:04:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-return-events-with-excluded-field-value-combined-with/m-p/642856#M222651</guid>
      <dc:creator>foxglove</dc:creator>
      <dc:date>2023-05-11T02:04:53Z</dc:date>
    </item>
    <item>
      <title>Re: Return events with excluded field value combined with all events that have no value for that field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-return-events-with-excluded-field-value-combined-with/m-p/642929#M222681</link>
      <description>&lt;P&gt;So you want this?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;search .... (field!=value OR NOT field=*)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 10 May 2023 22:25:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-return-events-with-excluded-field-value-combined-with/m-p/642929#M222681</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-05-10T22:25:18Z</dc:date>
    </item>
    <item>
      <title>Re: Return events with excluded field value combined with all events that have no value for that field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-return-events-with-excluded-field-value-combined-with/m-p/642934#M222685</link>
      <description>&lt;P&gt;I believe what you're looking to do should be implicitly solved by searching&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;NOT field=value&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;When searching with != you are also telling Splunk to only return results with a valid entry for that field. Take a look at the documentation for &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/Search/NOTexpressions" target="_blank" rel="noopener"&gt;Difference between != and NOT&lt;/A&gt; for an in-depth&amp;nbsp; breakdown of the differences.&lt;/P&gt;&lt;P&gt;But &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/256609"&gt;@foxglove&lt;/a&gt; your question is a bit ambiguous, are you searching against two separate fields, looking for both null/nonexistent value and non-excluded values, or only null/nonexistent values that also don't match the searched value?&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 00:27:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-return-events-with-excluded-field-value-combined-with/m-p/642934#M222685</guid>
      <dc:creator>2ero</dc:creator>
      <dc:date>2023-05-11T00:27:33Z</dc:date>
    </item>
    <item>
      <title>Re: Return events with excluded field value combined with all events that have no value for that field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-return-events-with-excluded-field-value-combined-with/m-p/643036#M222741</link>
      <description>&lt;P&gt;Apologies for the ambiguity. I did mean the same field. Your solution is what I was looking for, so thank you. I forgot about the implicit nature of NOT in that it excludes all events that have a particular value for that field, which would include all events that do not any value for that field at all. Thanks again!&lt;/P&gt;</description>
      <pubDate>Thu, 11 May 2023 12:50:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-return-events-with-excluded-field-value-combined-with/m-p/643036#M222741</guid>
      <dc:creator>foxglove</dc:creator>
      <dc:date>2023-05-11T12:50:01Z</dc:date>
    </item>
  </channel>
</rss>

