<?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: splunk search language in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-language/m-p/20607#M3250</link>
    <description>&lt;P&gt;Thank you also for the quick answer...&lt;/P&gt;

&lt;P&gt;i can't just use index and sourcetype because i run postprocess searches on the results and i get nothing unless i specify the fields=*... &lt;/P&gt;

&lt;P&gt;using the NOT != is a bit messy...&lt;/P&gt;

&lt;P&gt;i resolved my issue by using eval to write "NULL" into the empty fields.&lt;/P&gt;

&lt;P&gt;Again thanks for the help.&lt;/P&gt;</description>
    <pubDate>Wed, 01 Jun 2011 18:43:28 GMT</pubDate>
    <dc:creator>kenchisho</dc:creator>
    <dc:date>2011-06-01T18:43:28Z</dc:date>
    <item>
      <title>splunk search language</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-language/m-p/20603#M3246</link>
      <description>&lt;P&gt;Hi guys...&lt;/P&gt;

&lt;P&gt;I have been working on a few splunk apps during the last 6 months... in that time i have ran into a peculiar problem a couple of times... the problem being the folowing:&lt;/P&gt;

&lt;P&gt;when i use a search like: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="index" sourcetype="sourcertype" field1="*" field2="*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I expect all the results because i am not filtering anything... but instead i get only a small fraction of the indexed logs...&lt;/P&gt;

&lt;P&gt;when i use the same search only writted differently like so:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="index" sourcetype="sourcertype" NOT (field1!="*" field2!="*")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I get all the indexed data as expected...&lt;/P&gt;

&lt;P&gt;Has anyone else ran into this or is it just me?&lt;/P&gt;

&lt;P&gt;and&lt;/P&gt;

&lt;P&gt;Has anyone found a solution to this besides rewriting the search to say the exactly the same thing...&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2011 10:09:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-language/m-p/20603#M3246</guid>
      <dc:creator>kenchisho</dc:creator>
      <dc:date>2011-06-01T10:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search language</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-language/m-p/20604#M3247</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;field1="*"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;will filter and return all events where field1 is present.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2011 11:56:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-language/m-p/20604#M3247</guid>
      <dc:creator>ziegfried</dc:creator>
      <dc:date>2011-06-01T11:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search language</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-language/m-p/20605#M3248</link>
      <description>&lt;P&gt;Exactly, and so you might ask why your second search works. Well, here's why:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;field=&lt;/STRONG&gt;* returns all events that have a value in that field; i.e. NOT NULL&lt;/P&gt;

&lt;P&gt;So, you might expect that &lt;STRONG&gt;field!=&lt;/STRONG&gt;* would return all events where there is not a value in the specified field i.e. NULL. But, that is not the case. &lt;/P&gt;

&lt;P&gt;The way to search for NULL values is with:&lt;BR /&gt;
NOT field=*&lt;/P&gt;

&lt;P&gt;Go ahead and test a search with field!=* and you will get 0 matching results. This appears to be an exception to where NOT and ! do not return the same results. Or, I'm not understanding the difference clearly enough. &lt;/P&gt;

&lt;P&gt;So, in your example your field=* term was in fact filtering out events. Specifically those that don't have a value in the specified field. (You might want to investigate why that is the case if it is not what you are expecting). &lt;/P&gt;

&lt;P&gt;In your second example when you negate field!=* (which returns 0 results) with NOT field!=* you get all results. &lt;/P&gt;

&lt;P&gt;It seems like in your example you just need to use index="index" and sourcetype="sourcetype"&lt;/P&gt;

&lt;P&gt;I hope this helps. &lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2011 14:29:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-language/m-p/20605#M3248</guid>
      <dc:creator>khodges_splunk</dc:creator>
      <dc:date>2011-06-01T14:29:07Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search language</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-language/m-p/20606#M3249</link>
      <description>&lt;P&gt;Thanks for the quick answer.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2011 18:35:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-language/m-p/20606#M3249</guid>
      <dc:creator>kenchisho</dc:creator>
      <dc:date>2011-06-01T18:35:04Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search language</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-language/m-p/20607#M3250</link>
      <description>&lt;P&gt;Thank you also for the quick answer...&lt;/P&gt;

&lt;P&gt;i can't just use index and sourcetype because i run postprocess searches on the results and i get nothing unless i specify the fields=*... &lt;/P&gt;

&lt;P&gt;using the NOT != is a bit messy...&lt;/P&gt;

&lt;P&gt;i resolved my issue by using eval to write "NULL" into the empty fields.&lt;/P&gt;

&lt;P&gt;Again thanks for the help.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jun 2011 18:43:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-language/m-p/20607#M3250</guid>
      <dc:creator>kenchisho</dc:creator>
      <dc:date>2011-06-01T18:43:28Z</dc:date>
    </item>
    <item>
      <title>Re: splunk search language</title>
      <link>https://community.splunk.com/t5/Splunk-Search/splunk-search-language/m-p/20608#M3251</link>
      <description>&lt;P&gt;I am running into the same problem, can you share the eval command you ran to write NULL in the empty fields?&lt;/P&gt;</description>
      <pubDate>Fri, 06 Sep 2013 18:56:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/splunk-search-language/m-p/20608#M3251</guid>
      <dc:creator>JoeSco27</dc:creator>
      <dc:date>2013-09-06T18:56:24Z</dc:date>
    </item>
  </channel>
</rss>

