<?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: Error in 'eval' command: The expression is malformed. Expected ). in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-expression-is-malformed-Expected/m-p/20871#M3333</link>
    <description>&lt;P&gt;Gilberto, thanks so much for the rapid response and detailed explanation.&lt;/P&gt;</description>
    <pubDate>Wed, 31 Jul 2013 19:56:58 GMT</pubDate>
    <dc:creator>bandit</dc:creator>
    <dc:date>2013-07-31T19:56:58Z</dc:date>
    <item>
      <title>Error in 'eval' command: The expression is malformed. Expected ).</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-expression-is-malformed-Expected/m-p/20869#M3331</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;# have a summary index which stores load averages
index=summary10min | table 10_min_load_avg

1   0.140000
2   0.720000
3   0.030000
4   0.080000
5   0.070000

# I'm trying to search the summary index for the max value from the last two events and store in a new field
# I'm getting a syntax error from the eval command
index=summary10min  | head 2 | eval 10_min_load_max=max(10_min_load_avg)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;ERROR MESSAGE: Error in 'eval' command: The expression is malformed. Expected ).&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2013 18:29:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-expression-is-malformed-Expected/m-p/20869#M3331</guid>
      <dc:creator>bandit</dc:creator>
      <dc:date>2013-07-31T18:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: Error in 'eval' command: The expression is malformed. Expected ).</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-expression-is-malformed-Expected/m-p/20870#M3332</link>
      <description>&lt;P&gt;Splunk does not like it when a field name, or variable, starts with a numeric assignment. For example, when I run this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count 
| eval ten_min_load_avg="1,2,3,3,4,5" 
| makemv delim="," ten_min_load_avg 
| eval ten_min_load_max=max(ten_min_load_avg)
| fields - count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And, you get this:&lt;/P&gt;

&lt;H2&gt;&lt;IMG src="http://splunk-base.splunk.com//storage/Untitled1003.png" alt="alt text" /&gt;&lt;/H2&gt;

&lt;P&gt;However, when you try this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| stats count 
| eval 10_min_load_avg="1,2,3,3,4,5" 
| makemv delim="," 10_min_load_avg 
| eval 10_min_load_max=max(10_min_load_avg)
| fields - count
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You will get this:&lt;/P&gt;

&lt;P&gt;&lt;IMG src="http://splunk-base.splunk.com//storage/Untitled1004.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;So, rename your field to start with a alphabetic character and you are in business... &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2013 19:09:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-expression-is-malformed-Expected/m-p/20870#M3332</guid>
      <dc:creator>Gilberto_Castil</dc:creator>
      <dc:date>2013-07-31T19:09:53Z</dc:date>
    </item>
    <item>
      <title>Re: Error in 'eval' command: The expression is malformed. Expected ).</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-expression-is-malformed-Expected/m-p/20871#M3333</link>
      <description>&lt;P&gt;Gilberto, thanks so much for the rapid response and detailed explanation.&lt;/P&gt;</description>
      <pubDate>Wed, 31 Jul 2013 19:56:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-expression-is-malformed-Expected/m-p/20871#M3333</guid>
      <dc:creator>bandit</dc:creator>
      <dc:date>2013-07-31T19:56:58Z</dc:date>
    </item>
    <item>
      <title>Re: Error in 'eval' command: The expression is malformed. Expected ).</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-expression-is-malformed-Expected/m-p/20872#M3334</link>
      <description>&lt;P&gt;Thank you sooo much! You saved me from ripping off all the hair on my head &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; &lt;/P&gt;</description>
      <pubDate>Fri, 18 Nov 2016 17:51:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-expression-is-malformed-Expected/m-p/20872#M3334</guid>
      <dc:creator>manmeet99</dc:creator>
      <dc:date>2016-11-18T17:51:35Z</dc:date>
    </item>
    <item>
      <title>Re: Error in 'eval' command: The expression is malformed. Expected ).</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-expression-is-malformed-Expected/m-p/20873#M3335</link>
      <description>&lt;P&gt;I got a simmilar problem, but with {} in the fieldname. I guess any other special characters in the field name is problematic and require a rename of the inputfieldname. Had to rename the field like this to make it work:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;rename  results{}.dob.age as dob_age&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 09 Jul 2019 08:38:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Error-in-eval-command-The-expression-is-malformed-Expected/m-p/20873#M3335</guid>
      <dc:creator>pgerke_cc</dc:creator>
      <dc:date>2019-07-09T08:38:07Z</dc:date>
    </item>
  </channel>
</rss>

