<?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: removing zero values or using where clause with multiple eval statements in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/removing-zero-values-or-using-where-clause-with-multiple-eval/m-p/368720#M108685</link>
    <description>&lt;P&gt;Thank you for clearing this up.  If you change your comment to an answer I will gladly mark this correct.  Didn't know the difference between "Portal Logins" and 'Portal Logins'.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Dec 2017 19:47:20 GMT</pubDate>
    <dc:creator>agreer</dc:creator>
    <dc:date>2017-12-29T19:47:20Z</dc:date>
    <item>
      <title>removing zero values or using where clause with multiple eval statements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/removing-zero-values-or-using-where-clause-with-multiple-eval/m-p/368716#M108681</link>
      <description>&lt;P&gt;I am running the query below:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=onelogin_roll role_id{} != null email!="*surfspamfree.com" email!="*littler.com" email != "unknown" company!=Fastcase
|dedup email
|join type email
     [|search sourcetype = drupal_app_logs domain_type = "clientportal" email != "*surfspamfree.com" email !="*@littler.com" email != "unknown"
      |eval mytime=strftime(_time, "%Y-%m-%d-%T") 
      |eval Portallogins=if((trim(upper(action))=trim(upper("User Login")) AND trim(upper(domain))!=trim(upper("Login Portal"))),1,0)
      |eval Globallogins=if(like (message,"%Global Guide%"),1,0)
      |eval GPSlogins=if(like (message,"%Littler GPS%"),1,0)
      |eval LCSlogins=if(like (message,"%CaseSmart&amp;amp;%") AND action="Main Navigation Page Visit",1,0)
      |stats max(mytime) as "Last Login" sum(Globallogins) as "Global Visits" sum(Portallogins) as "Portal Logins" sum(GPSlogins) as "GPS Visits" sum(LCSlogins) as "LCS Visits" by email]

|table email,firstname, lastname,company,title,"Last Login",password_changed_at,"Portal Logins","Global Visits","GPS Visits","LCS Visits"
|sort -"Portal Logins"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I do not want to return any 0 values for Portallogins or "Portal Logins."  My research indicates the following would need to be added:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; |where Portallogins&amp;gt;0
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Depending where this is placed the 0 values are not removed or it will sum the Portallogins and report 0 for all the other eval statements.  Any advise wold be greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 17:40:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/removing-zero-values-or-using-where-clause-with-multiple-eval/m-p/368716#M108681</guid>
      <dc:creator>agreer</dc:creator>
      <dc:date>2017-12-29T17:40:37Z</dc:date>
    </item>
    <item>
      <title>Re: removing zero values or using where clause with multiple eval statements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/removing-zero-values-or-using-where-clause-with-multiple-eval/m-p/368717#M108682</link>
      <description>&lt;P&gt;Since you're doing inner join, I don't think it'll make a difference. You can put you where clause inside your subsearch (probably best so that you can reduce the number of rows to be joined, which is very expensive BTW) or towards end of the search (of course, field is renamed so you'd use &lt;CODE&gt;| where 'Portal Logins'&amp;gt;0&lt;/CODE&gt;)&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 19:10:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/removing-zero-values-or-using-where-clause-with-multiple-eval/m-p/368717#M108682</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-29T19:10:46Z</dc:date>
    </item>
    <item>
      <title>Re: removing zero values or using where clause with multiple eval statements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/removing-zero-values-or-using-where-clause-with-multiple-eval/m-p/368718#M108683</link>
      <description>&lt;P&gt;SMH, this was tried with:&lt;/P&gt;

&lt;P&gt;| where "Portal Logins"&amp;gt;"0"&lt;/P&gt;

&lt;P&gt;with the results I identified in the original summary.&lt;BR /&gt;&lt;BR /&gt;
Your advice below works:&lt;/P&gt;

&lt;P&gt;|where 'Portal Logins'&amp;gt;0&lt;/P&gt;

&lt;P&gt;When should (') be used over (")?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 19:20:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/removing-zero-values-or-using-where-clause-with-multiple-eval/m-p/368718#M108683</guid>
      <dc:creator>agreer</dc:creator>
      <dc:date>2017-12-29T19:20:41Z</dc:date>
    </item>
    <item>
      <title>Re: removing zero values or using where clause with multiple eval statements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/removing-zero-values-or-using-where-clause-with-multiple-eval/m-p/368719#M108684</link>
      <description>&lt;P&gt;You'd use single quotes (for field whose name contains special characters including spaces) in &lt;CODE&gt;eval&lt;/CODE&gt; and &lt;CODE&gt;where&lt;/CODE&gt;. If you're using eval within a stats or timechart (e.g. &lt;CODE&gt;| stats count(eval(status="Success")) as Success&lt;/CODE&gt;, then also you'd use single quotes. For all other commands or variation of commands, you'll use double quotes (rename, stats, timechart, bucket etc)&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 19:35:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/removing-zero-values-or-using-where-clause-with-multiple-eval/m-p/368719#M108684</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-29T19:35:30Z</dc:date>
    </item>
    <item>
      <title>Re: removing zero values or using where clause with multiple eval statements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/removing-zero-values-or-using-where-clause-with-multiple-eval/m-p/368720#M108685</link>
      <description>&lt;P&gt;Thank you for clearing this up.  If you change your comment to an answer I will gladly mark this correct.  Didn't know the difference between "Portal Logins" and 'Portal Logins'.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 19:47:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/removing-zero-values-or-using-where-clause-with-multiple-eval/m-p/368720#M108685</guid>
      <dc:creator>agreer</dc:creator>
      <dc:date>2017-12-29T19:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: removing zero values or using where clause with multiple eval statements</title>
      <link>https://community.splunk.com/t5/Splunk-Search/removing-zero-values-or-using-where-clause-with-multiple-eval/m-p/368721#M108686</link>
      <description>&lt;P&gt;Here you go.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Dec 2017 19:49:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/removing-zero-values-or-using-where-clause-with-multiple-eval/m-p/368721#M108686</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-12-29T19:49:23Z</dc:date>
    </item>
  </channel>
</rss>

