<?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: Any difference between NULL and null() in eval? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Any-difference-between-NULL-and-null-in-eval/m-p/326155#M97249</link>
    <description>&lt;P&gt;In the former case, you are setting it to the value of the field named &lt;CODE&gt;NULL&lt;/CODE&gt;, which in your case, clearly doesn't exist right now HOWEVER that might not always be the case.  It is equivalent to &lt;CODE&gt;if(isnotnull(fieldX), fieldX*10, ThisFieldNameDoesNotExistSoTheValueThatItHasAlsoDoesNotExistSoRightNowThisEvaluatesToNULL)&lt;/CODE&gt;.  So it is very poor practice to use the former and you should use the latter.&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jul 2017 22:20:18 GMT</pubDate>
    <dc:creator>woodcock</dc:creator>
    <dc:date>2017-07-20T22:20:18Z</dc:date>
    <item>
      <title>Any difference between NULL and null() in eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Any-difference-between-NULL-and-null-in-eval/m-p/326154#M97248</link>
      <description>&lt;P&gt;In an eval expression, is there any difference between using &lt;CODE&gt;NULL&lt;/CODE&gt; and &lt;CODE&gt;null()&lt;/CODE&gt;?&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Use case:&lt;/STRONG&gt; I want to return &lt;EM&gt;null&lt;/EM&gt; in an eval expression. I am finding that the following two expressions give the same result and I want to make sure that both are officially correct:&lt;/P&gt;

&lt;UL&gt;
&lt;LI&gt;if (isnotnull (fieldX), fieldX * 10, NULL)&lt;/LI&gt;
&lt;LI&gt;if (isnotnull (fieldX), fieldX * 10, null())&lt;/LI&gt;
&lt;/UL&gt;</description>
      <pubDate>Thu, 20 Jul 2017 22:14:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Any-difference-between-NULL-and-null-in-eval/m-p/326154#M97248</guid>
      <dc:creator>helge</dc:creator>
      <dc:date>2017-07-20T22:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Any difference between NULL and null() in eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Any-difference-between-NULL-and-null-in-eval/m-p/326155#M97249</link>
      <description>&lt;P&gt;In the former case, you are setting it to the value of the field named &lt;CODE&gt;NULL&lt;/CODE&gt;, which in your case, clearly doesn't exist right now HOWEVER that might not always be the case.  It is equivalent to &lt;CODE&gt;if(isnotnull(fieldX), fieldX*10, ThisFieldNameDoesNotExistSoTheValueThatItHasAlsoDoesNotExistSoRightNowThisEvaluatesToNULL)&lt;/CODE&gt;.  So it is very poor practice to use the former and you should use the latter.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 22:20:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Any-difference-between-NULL-and-null-in-eval/m-p/326155#M97249</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-07-20T22:20:18Z</dc:date>
    </item>
    <item>
      <title>Re: Any difference between NULL and null() in eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Any-difference-between-NULL-and-null-in-eval/m-p/326156#M97250</link>
      <description>&lt;P&gt;Now you mention it the answer is quite obvious &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;BR /&gt;
Thanks!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 22:23:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Any-difference-between-NULL-and-null-in-eval/m-p/326156#M97250</guid>
      <dc:creator>helge</dc:creator>
      <dc:date>2017-07-20T22:23:20Z</dc:date>
    </item>
    <item>
      <title>Re: Any difference between NULL and null() in eval?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Any-difference-between-NULL-and-null-in-eval/m-p/326157#M97251</link>
      <description>&lt;P&gt;Ah yes, The Field Who Must Not Be Named...&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jul 2017 22:40:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Any-difference-between-NULL-and-null-in-eval/m-p/326157#M97251</guid>
      <dc:creator>DalJeanis</dc:creator>
      <dc:date>2017-07-20T22:40:27Z</dc:date>
    </item>
  </channel>
</rss>

