<?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 How to use If and Not statement in one pass? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-If-and-Not-statement-in-one-pass/m-p/414681#M119442</link>
    <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;What's the best way to use a NOT statement in an if statement.  I'm trying to accomplish something similar to the below. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval x_height=if(isnull(x_height) AND NOT (sourcetype=mysourcetypeHere),"Not Defined",x_height)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 29 Jun 2018 23:08:02 GMT</pubDate>
    <dc:creator>splunker1981</dc:creator>
    <dc:date>2018-06-29T23:08:02Z</dc:date>
    <item>
      <title>How to use If and Not statement in one pass?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-If-and-Not-statement-in-one-pass/m-p/414681#M119442</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;What's the best way to use a NOT statement in an if statement.  I'm trying to accomplish something similar to the below. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval x_height=if(isnull(x_height) AND NOT (sourcetype=mysourcetypeHere),"Not Defined",x_height)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 29 Jun 2018 23:08:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-If-and-Not-statement-in-one-pass/m-p/414681#M119442</guid>
      <dc:creator>splunker1981</dc:creator>
      <dc:date>2018-06-29T23:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to use If and Not statement in one pass?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-If-and-Not-statement-in-one-pass/m-p/414682#M119443</link>
      <description>&lt;P&gt;This is more clear:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval x_height=if((sourcetype=="mysourcetypeHere"), null(), coalesce(x_height, "Not Defined")) 
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 30 Jun 2018 02:28:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-If-and-Not-statement-in-one-pass/m-p/414682#M119443</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2018-06-30T02:28:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to use If and Not statement in one pass?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-If-and-Not-statement-in-one-pass/m-p/414683#M119444</link>
      <description>&lt;P&gt;That worked, thanks!&lt;/P&gt;</description>
      <pubDate>Sat, 30 Jun 2018 04:37:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-If-and-Not-statement-in-one-pass/m-p/414683#M119444</guid>
      <dc:creator>splunker1981</dc:creator>
      <dc:date>2018-06-30T04:37:12Z</dc:date>
    </item>
  </channel>
</rss>

