<?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 Return command giving error for stats c(eval...) in splunk in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Return-command-giving-error-for-stats-c-eval-in-splunk/m-p/340588#M101018</link>
    <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;

&lt;P&gt;Am creating the dynamic query depending on condition and after that using &lt;CODE&gt;return&lt;/CODE&gt; command to execute that search query string, below is my search query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   [ | search query which gives me dynamic string.... | return $myquery ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where $myquery contain &lt;CODE&gt;index=xyz | stats c(eval(eventtype="myeventtype1")) as "myeventtype1", c(eval(eventtype="myeventtype2")) as "myeventtype2"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;but its giving me the error (actually its putting the each eventtype value while executing), is there any way where we can execute this query without any error?&lt;/P&gt;

&lt;P&gt;Note: when i execute myquery string manually its perfectly working fine.&lt;/P&gt;

&lt;P&gt;Can any on help me here?&lt;/P&gt;

&lt;P&gt;Thank you &lt;/P&gt;</description>
    <pubDate>Mon, 06 Mar 2017 13:28:01 GMT</pubDate>
    <dc:creator>snehalk</dc:creator>
    <dc:date>2017-03-06T13:28:01Z</dc:date>
    <item>
      <title>Return command giving error for stats c(eval...) in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-command-giving-error-for-stats-c-eval-in-splunk/m-p/340588#M101018</link>
      <description>&lt;P&gt;Hello Everyone,&lt;/P&gt;

&lt;P&gt;Am creating the dynamic query depending on condition and after that using &lt;CODE&gt;return&lt;/CODE&gt; command to execute that search query string, below is my search query&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;   [ | search query which gives me dynamic string.... | return $myquery ]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;where $myquery contain &lt;CODE&gt;index=xyz | stats c(eval(eventtype="myeventtype1")) as "myeventtype1", c(eval(eventtype="myeventtype2")) as "myeventtype2"&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;but its giving me the error (actually its putting the each eventtype value while executing), is there any way where we can execute this query without any error?&lt;/P&gt;

&lt;P&gt;Note: when i execute myquery string manually its perfectly working fine.&lt;/P&gt;

&lt;P&gt;Can any on help me here?&lt;/P&gt;

&lt;P&gt;Thank you &lt;/P&gt;</description>
      <pubDate>Mon, 06 Mar 2017 13:28:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-command-giving-error-for-stats-c-eval-in-splunk/m-p/340588#M101018</guid>
      <dc:creator>snehalk</dc:creator>
      <dc:date>2017-03-06T13:28:01Z</dc:date>
    </item>
    <item>
      <title>Re: Return command giving error for stats c(eval...) in splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-command-giving-error-for-stats-c-eval-in-splunk/m-p/340589#M101019</link>
      <description>&lt;P&gt;Why bother with the extra stuff; just do this ( &lt;CODE&gt;search&lt;/CODE&gt; is a special field name returning from subsearches):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  [ | search query which gives me dynamic string.... | rename myquery AS search ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 25 Mar 2017 09:44:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-command-giving-error-for-stats-c-eval-in-splunk/m-p/340589#M101019</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-03-25T09:44:59Z</dc:date>
    </item>
  </channel>
</rss>

