<?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: Working with the NOT command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Working-with-the-NOT-command/m-p/642738#M222619</link>
    <description>&lt;P&gt;There are two ways to do a negative test in SPL - the &lt;FONT face="courier new,courier"&gt;NOT&lt;/FONT&gt; operator and the &lt;FONT face="courier new,courier"&gt;!=&lt;/FONT&gt; operator.&amp;nbsp; Each has slightly different syntax and behaves slightly differently.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval result=if(ExitStatus!=0, "Error", "Success")&lt;/LI-CODE&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;!=&lt;/FONT&gt; operator looks at events that have an ExitStatus field that has a value.&amp;nbsp; Nulls are ignored.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval result=if(NOT ExitStatus=0, "Error", "Success")&lt;/LI-CODE&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;NOT&lt;/FONT&gt; operator looks at all events, even those that do not have an ExitStatus field.&amp;nbsp; Nulls are included.&amp;nbsp; A null does not match the target value.&lt;/P&gt;&lt;P&gt;That said, I think you don't need either operator.&amp;nbsp; Just have the pie chart show how many of each ExitStatus there is.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| chart count by ExitStatus&lt;/LI-CODE&gt;&lt;P&gt;If you really want only 2 values displayed then you can normalize the values before charting them.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval ExitStatus=if(ExitStatus&amp;gt;0, 1, 0)
| chart count by ExitStatus&lt;/LI-CODE&gt;</description>
    <pubDate>Tue, 09 May 2023 21:38:57 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2023-05-09T21:38:57Z</dc:date>
    <item>
      <title>Working with the NOT command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Working-with-the-NOT-command/m-p/642737#M222618</link>
      <description>&lt;P&gt;So I am trying to search through some results and I am trying to display the results that ExitStatus=0 which means it ran correctly and ExitStatus=anything else which is not 0, meaning it is an error. I am looking to have a pie chart which it shows either ExitStatus=0 or ExitStatus= NOT 1.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 09 May 2023 20:56:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Working-with-the-NOT-command/m-p/642737#M222618</guid>
      <dc:creator>jialiu907</dc:creator>
      <dc:date>2023-05-09T20:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: Working with the NOT command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Working-with-the-NOT-command/m-p/642738#M222619</link>
      <description>&lt;P&gt;There are two ways to do a negative test in SPL - the &lt;FONT face="courier new,courier"&gt;NOT&lt;/FONT&gt; operator and the &lt;FONT face="courier new,courier"&gt;!=&lt;/FONT&gt; operator.&amp;nbsp; Each has slightly different syntax and behaves slightly differently.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval result=if(ExitStatus!=0, "Error", "Success")&lt;/LI-CODE&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;!=&lt;/FONT&gt; operator looks at events that have an ExitStatus field that has a value.&amp;nbsp; Nulls are ignored.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval result=if(NOT ExitStatus=0, "Error", "Success")&lt;/LI-CODE&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;NOT&lt;/FONT&gt; operator looks at all events, even those that do not have an ExitStatus field.&amp;nbsp; Nulls are included.&amp;nbsp; A null does not match the target value.&lt;/P&gt;&lt;P&gt;That said, I think you don't need either operator.&amp;nbsp; Just have the pie chart show how many of each ExitStatus there is.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| chart count by ExitStatus&lt;/LI-CODE&gt;&lt;P&gt;If you really want only 2 values displayed then you can normalize the values before charting them.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval ExitStatus=if(ExitStatus&amp;gt;0, 1, 0)
| chart count by ExitStatus&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 09 May 2023 21:38:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Working-with-the-NOT-command/m-p/642738#M222619</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-05-09T21:38:57Z</dc:date>
    </item>
  </channel>
</rss>

