<?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: EVAL statement not correct in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/EVAL-statement-not-correct/m-p/317940#M95132</link>
    <description>&lt;P&gt;when i run this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults|eval "(g)Location"="Varonis" |eval MonitoringStatus="notMonitored"|eval Path="Hosting"| eval VaronisStatus=if(('(g)Location'!="Varonis" AND (MonitoringStatus!="Monitored") AND like(Path,"%Hosting%")),"Action Required", "No Action Required")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i get "No Action Required" and when i change the &lt;CODE&gt;(g)Location&lt;/CODE&gt; to &lt;STRONG&gt;notVaronis&lt;/STRONG&gt;, I get &lt;STRONG&gt;Action Required&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;what exactly isn't working with this?&lt;/P&gt;</description>
    <pubDate>Wed, 17 Jan 2018 13:30:56 GMT</pubDate>
    <dc:creator>cmerriman</dc:creator>
    <dc:date>2018-01-17T13:30:56Z</dc:date>
    <item>
      <title>EVAL statement not correct</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-statement-not-correct/m-p/317938#M95130</link>
      <description>&lt;P&gt;My eval statement below is to check if 'Action is Required' only if the below conditions are met, I have also used case and if statement to determine this, however none of these have worked.&lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;Location does not equal Varonis (i.e equals Not in Varonis)&lt;/LI&gt;
&lt;LI&gt;MonitoringStatus does not equal Monitored (i.e equals Not Monitored)&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Contains the word "Hosting" in the Path field&lt;/P&gt;

&lt;P&gt;| eval VaronisStatus=if(('(g)Location'!="Varonis" AND(MonitoringStatus!="Monitored") AND like(Path,"%Hosting%")),"Action Required", "No Action Required")&lt;/P&gt;

&lt;P&gt;|| eval VaronisStatus=case(('(g)Location'!="Varonis" AND(MonitoringStatus!="Monitored") AND like(Path,"%Hosting%")),"Action Required" , 1=1,"No Action Required") &lt;/P&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Wed, 17 Jan 2018 13:13:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-statement-not-correct/m-p/317938#M95130</guid>
      <dc:creator>davidcraven02</dc:creator>
      <dc:date>2018-01-17T13:13:01Z</dc:date>
    </item>
    <item>
      <title>Re: EVAL statement not correct</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-statement-not-correct/m-p/317939#M95131</link>
      <description>&lt;P&gt;try this run anywhere search &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults|eval "(g)Location"="Varonis" |eval MonitoringStatus="NotMonitored"|eval Path="Hosting"| eval VaronisStatus=if('(g)Location'!="Varonis" AND MonitoringStatus!="Monitored" AND like(Path,"%Hosting%"),"Action Required", "No Action Required")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;you should try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval VaronisStatus=if('(g)Location'!="Varonis" AND MonitoringStatus!="Monitored" AND like(Path,"%Hosting%"),"Action Required", "No Action Required")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;let me know if this helps !&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 13:25:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-statement-not-correct/m-p/317939#M95131</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2018-01-17T13:25:21Z</dc:date>
    </item>
    <item>
      <title>Re: EVAL statement not correct</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-statement-not-correct/m-p/317940#M95132</link>
      <description>&lt;P&gt;when i run this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|makeresults|eval "(g)Location"="Varonis" |eval MonitoringStatus="notMonitored"|eval Path="Hosting"| eval VaronisStatus=if(('(g)Location'!="Varonis" AND (MonitoringStatus!="Monitored") AND like(Path,"%Hosting%")),"Action Required", "No Action Required")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;i get "No Action Required" and when i change the &lt;CODE&gt;(g)Location&lt;/CODE&gt; to &lt;STRONG&gt;notVaronis&lt;/STRONG&gt;, I get &lt;STRONG&gt;Action Required&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;what exactly isn't working with this?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 13:30:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-statement-not-correct/m-p/317940#M95132</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2018-01-17T13:30:56Z</dc:date>
    </item>
    <item>
      <title>Re: EVAL statement not correct</title>
      <link>https://community.splunk.com/t5/Splunk-Search/EVAL-statement-not-correct/m-p/317941#M95133</link>
      <description>&lt;P&gt;Both of your approaches work on my system with test events. I don't see any functional difference between your first approach and the one suggested by @mayurr98 below, but if it works for you, great. If it doesn't, can you share some sample events that are being incorrectly categorized?&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jan 2018 14:04:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/EVAL-statement-not-correct/m-p/317941#M95133</guid>
      <dc:creator>elliotproebstel</dc:creator>
      <dc:date>2018-01-17T14:04:11Z</dc:date>
    </item>
  </channel>
</rss>

