<?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: Issue with stats count(eval()) command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344314#M101994</link>
    <description>&lt;P&gt;hey &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/65460"&gt;@jvmerilla&lt;/a&gt;&lt;/P&gt;

&lt;P&gt;Try this,&lt;BR /&gt;
    index="sample_data" sourcetype="analytics_sampledata.csv" &lt;BR /&gt;
     | rename "Resolution Code" as Resolution_Code&lt;BR /&gt;
     | stats count(eval(Status!="Closed")) as "Open Tickets", count(eval((like(Resolution_Code,"Not Resolved%")) AND Status="Closed")) as "Closed/Not Resolved Tickets"&lt;/P&gt;

&lt;P&gt;Let me know if it helps!&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 17:16:59 GMT</pubDate>
    <dc:creator>mayurr98</dc:creator>
    <dc:date>2020-09-29T17:16:59Z</dc:date>
    <item>
      <title>Issue with stats count(eval()) command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344312#M101992</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I have this query:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="sample_data" sourcetype="analytics_sampledata.csv" 
| rename "Resolution Code" as Resolution_Code
| stats count(eval(Status!="Closed")) as "Open Tickets", count(eval(Status="Closed" AND Resolution_Code="Not Resolved *")) as "Closed/Not Resolved Tickets"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And this is the result:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/4001i73963B8AF9A8F3DD/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;I don't know what could be wrong with query but the second &lt;CODE&gt;eval&lt;/CODE&gt; is not returning any value.&lt;/P&gt;

&lt;P&gt;I hope anyone would shed a light on this.&lt;/P&gt;

&lt;P&gt;Thank you.&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 08:46:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344312#M101992</guid>
      <dc:creator>jvmerilla</dc:creator>
      <dc:date>2017-12-13T08:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with stats count(eval()) command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344313#M101993</link>
      <description>&lt;P&gt;I don't think that eval supports wildcards (*).&lt;/P&gt;

&lt;P&gt;Try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval(Status=="Closed" AND like(Resolution_Code,"Not Resolved %"))
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 13 Dec 2017 09:00:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344313#M101993</guid>
      <dc:creator>Yunagi</dc:creator>
      <dc:date>2017-12-13T09:00:23Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with stats count(eval()) command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344314#M101994</link>
      <description>&lt;P&gt;hey &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/65460"&gt;@jvmerilla&lt;/a&gt;&lt;/P&gt;

&lt;P&gt;Try this,&lt;BR /&gt;
    index="sample_data" sourcetype="analytics_sampledata.csv" &lt;BR /&gt;
     | rename "Resolution Code" as Resolution_Code&lt;BR /&gt;
     | stats count(eval(Status!="Closed")) as "Open Tickets", count(eval((like(Resolution_Code,"Not Resolved%")) AND Status="Closed")) as "Closed/Not Resolved Tickets"&lt;/P&gt;

&lt;P&gt;Let me know if it helps!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 17:16:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344314#M101994</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2020-09-29T17:16:59Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with stats count(eval()) command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344315#M101995</link>
      <description>&lt;P&gt;Hi @Yunagi,&lt;/P&gt;

&lt;P&gt;It works!&lt;/P&gt;

&lt;P&gt;Thanks for your help. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 09:05:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344315#M101995</guid>
      <dc:creator>jvmerilla</dc:creator>
      <dc:date>2017-12-13T09:05:10Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with stats count(eval()) command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344316#M101996</link>
      <description>&lt;P&gt;Hi @mayurr98,&lt;/P&gt;

&lt;P&gt;It also works. &lt;BR /&gt;
Thank you. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;So the main cause of the error is the &lt;CODE&gt;*&lt;/CODE&gt;, and also the format of the code?&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 09:09:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344316#M101996</guid>
      <dc:creator>jvmerilla</dc:creator>
      <dc:date>2017-12-13T09:09:38Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with stats count(eval()) command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344317#M101997</link>
      <description>&lt;P&gt;yeah eval does not support &lt;CODE&gt;*&lt;/CODE&gt;. In order to make it support you need to you &lt;CODE&gt;eval(like())&lt;/CODE&gt; and &lt;CODE&gt;%&lt;/CODE&gt; works as wildcard in that command.&lt;/P&gt;

&lt;P&gt;Refer this link, you will get an idea!&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/ConditionalFunctions#like.28TEXT.2C_PATTERN.29"&gt;http://docs.splunk.com/Documentation/Splunk/7.0.1/SearchReference/ConditionalFunctions#like.28TEXT.2C_PATTERN.29&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 09:14:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344317#M101997</guid>
      <dc:creator>mayurr98</dc:creator>
      <dc:date>2017-12-13T09:14:33Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with stats count(eval()) command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344318#M101998</link>
      <description>&lt;P&gt;I didn't know that.&lt;/P&gt;

&lt;P&gt;Thank you for your help. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 13 Dec 2017 09:22:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/344318#M101998</guid>
      <dc:creator>jvmerilla</dc:creator>
      <dc:date>2017-12-13T09:22:02Z</dc:date>
    </item>
    <item>
      <title>Re: Issue with stats count(eval()) command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/595425#M207227</link>
      <description>&lt;P&gt;I needed the double quotes too which I learned from your post. Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Apr 2022 13:58:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Issue-with-stats-count-eval-command/m-p/595425#M207227</guid>
      <dc:creator>lmonahan</dc:creator>
      <dc:date>2022-04-26T13:58:55Z</dc:date>
    </item>
  </channel>
</rss>

