<?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: &amp;quot;count&amp;quot; using &amp;quot;eval&amp;quot; not as described in documentation. Does eval return boolean results or not? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/quot-count-quot-using-quot-eval-quot-not-as-described-in/m-p/196006#M56516</link>
    <description>&lt;P&gt;From what I can tell, Splunk can use Booleans for internal logic (such as with "if" and "case" functions within &lt;CODE&gt;eval&lt;/CODE&gt;, or as something to mark and count as with &lt;CODE&gt;chart&lt;/CODE&gt;), but it cannot return them, in the sense that you can't use the &lt;CODE&gt;eval&lt;/CODE&gt; statement to generate a field that holds a Boolean value.&lt;/P&gt;

&lt;P&gt;The documentation is not inconsistent, but confusing. They are overloading the term &lt;CODE&gt;eval&lt;/CODE&gt; to be used in two different places, one as a standalone command, and one as a function that can be used as part of &lt;CODE&gt;count&lt;/CODE&gt; within the &lt;CODE&gt;chart&lt;/CODE&gt; command. In the first case, as it states, it cannot be used to create a field that holds a Boolean value. In the second case, it creates an internal Boolean state that can be counted into a field value. The documentation you are looking for isn't there because the documentation on the &lt;CODE&gt;eval&lt;/CODE&gt; command is unrelated to the documentation on the &lt;CODE&gt;chart&lt;/CODE&gt; command.&lt;/P&gt;

&lt;P&gt;The answer to your question "&lt;CODE&gt;count&lt;/CODE&gt; works with fields so it seems it returns field, but which one?" is that it may &lt;STRONG&gt;seem&lt;/STRONG&gt; to return a field, but it doesn't - it is only capable of creating an internal Boolean state that Splunk can count.&lt;/P&gt;</description>
    <pubDate>Tue, 20 Jan 2015 15:05:54 GMT</pubDate>
    <dc:creator>aweitzman</dc:creator>
    <dc:date>2015-01-20T15:05:54Z</dc:date>
    <item>
      <title>"count" using "eval" not as described in documentation. Does eval return boolean results or not?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-count-quot-using-quot-eval-quot-not-as-described-in/m-p/196002#M56512</link>
      <description>&lt;P&gt;In the documentation of "eval" command is written:&lt;/P&gt;

&lt;P&gt;"The result of an eval statement is not allowed to be boolean."&lt;BR /&gt;
(&lt;A href="http://docs.splunk.com/Documentation/Splunk/6.2.0/SearchReference/Eval"&gt;http://docs.splunk.com/Documentation/Splunk/6.2.0/SearchReference/Eval&lt;/A&gt;)&lt;/P&gt;

&lt;P&gt;but each time we use:&lt;BR /&gt;
chart count(eval( var1=="som")) by something&lt;/P&gt;

&lt;P&gt;we are getting as result of eval some boolean which is not "allowed" by documentation. Did I misunderstand something here? Does eval return boolean or not ?&lt;/P&gt;

&lt;P&gt;best regards,&lt;BR /&gt;
Milan&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2015 14:39:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-count-quot-using-quot-eval-quot-not-as-described-in/m-p/196002#M56512</guid>
      <dc:creator>milande</dc:creator>
      <dc:date>2015-01-20T14:39:51Z</dc:date>
    </item>
    <item>
      <title>Re: "count" using "eval" not as described in documentation. Does eval return boolean results or not?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-count-quot-using-quot-eval-quot-not-as-described-in/m-p/196003#M56513</link>
      <description>&lt;P&gt;&lt;CODE&gt;eval&lt;/CODE&gt; in general does not return Booleans. Using it within the &lt;CODE&gt;count&lt;/CODE&gt; function of &lt;CODE&gt;chart&lt;/CODE&gt; is a special case.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2015 14:45:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-count-quot-using-quot-eval-quot-not-as-described-in/m-p/196003#M56513</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-01-20T14:45:28Z</dc:date>
    </item>
    <item>
      <title>Re: "count" using "eval" not as described in documentation. Does eval return boolean results or not?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-count-quot-using-quot-eval-quot-not-as-described-in/m-p/196004#M56514</link>
      <description>&lt;P&gt;What exactly are you trying to do and what is the error message that you're seeing? &lt;BR /&gt;
Note that you have to rename the eval expression for the chart command to return.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;chart count(eval( var1=="som")) AS someName by something
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 20 Jan 2015 14:47:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-count-quot-using-quot-eval-quot-not-as-described-in/m-p/196004#M56514</guid>
      <dc:creator>_d_</dc:creator>
      <dc:date>2015-01-20T14:47:04Z</dc:date>
    </item>
    <item>
      <title>Re: "count" using "eval" not as described in documentation. Does eval return boolean results or not?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-count-quot-using-quot-eval-quot-not-as-described-in/m-p/196005#M56515</link>
      <description>&lt;P&gt;@ &lt;EM&gt;d&lt;/EM&gt; &lt;BR /&gt;
sorry I forget to put renaming. I am just trying to understand philosophy of SPLUNK, and its documentation. I have no error and this should help me to theoretically understand "eval" command.&lt;/P&gt;

&lt;P&gt;@ aweitzman &lt;BR /&gt;
yes I can see it is somehow special case but I am looking for documentation where is written otherwise. As far as I reported here "eval" does not return boolean. What does it then returns ? "count" works with fields so it seems it returns field, but which one ?&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2015 14:56:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-count-quot-using-quot-eval-quot-not-as-described-in/m-p/196005#M56515</guid>
      <dc:creator>milande</dc:creator>
      <dc:date>2015-01-20T14:56:47Z</dc:date>
    </item>
    <item>
      <title>Re: "count" using "eval" not as described in documentation. Does eval return boolean results or not?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/quot-count-quot-using-quot-eval-quot-not-as-described-in/m-p/196006#M56516</link>
      <description>&lt;P&gt;From what I can tell, Splunk can use Booleans for internal logic (such as with "if" and "case" functions within &lt;CODE&gt;eval&lt;/CODE&gt;, or as something to mark and count as with &lt;CODE&gt;chart&lt;/CODE&gt;), but it cannot return them, in the sense that you can't use the &lt;CODE&gt;eval&lt;/CODE&gt; statement to generate a field that holds a Boolean value.&lt;/P&gt;

&lt;P&gt;The documentation is not inconsistent, but confusing. They are overloading the term &lt;CODE&gt;eval&lt;/CODE&gt; to be used in two different places, one as a standalone command, and one as a function that can be used as part of &lt;CODE&gt;count&lt;/CODE&gt; within the &lt;CODE&gt;chart&lt;/CODE&gt; command. In the first case, as it states, it cannot be used to create a field that holds a Boolean value. In the second case, it creates an internal Boolean state that can be counted into a field value. The documentation you are looking for isn't there because the documentation on the &lt;CODE&gt;eval&lt;/CODE&gt; command is unrelated to the documentation on the &lt;CODE&gt;chart&lt;/CODE&gt; command.&lt;/P&gt;

&lt;P&gt;The answer to your question "&lt;CODE&gt;count&lt;/CODE&gt; works with fields so it seems it returns field, but which one?" is that it may &lt;STRONG&gt;seem&lt;/STRONG&gt; to return a field, but it doesn't - it is only capable of creating an internal Boolean state that Splunk can count.&lt;/P&gt;</description>
      <pubDate>Tue, 20 Jan 2015 15:05:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/quot-count-quot-using-quot-eval-quot-not-as-described-in/m-p/196006#M56516</guid>
      <dc:creator>aweitzman</dc:creator>
      <dc:date>2015-01-20T15:05:54Z</dc:date>
    </item>
  </channel>
</rss>

