<?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: Why am I getting &amp;quot;Error in 'eval' command: The expression is malformed. Expected ).&amp;quot; in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Error-in-eval-command-The-expression-is/m-p/283447#M85658</link>
    <description>&lt;P&gt;There seems to be a typo in your code and you need to use "where" instead of "search" when comparing fields:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Code |eval tmp="$ID$" | eval tmp=if(isnull(tmp),"",tmp) | where Instance_ID = tmp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also use the match operator. See &lt;A href="https://answers.splunk.com/answers/54063/compare-fields-for-like-match.html"&gt;this&lt;/A&gt; post&lt;/P&gt;</description>
    <pubDate>Thu, 17 Dec 2015 16:09:19 GMT</pubDate>
    <dc:creator>javiergn</dc:creator>
    <dc:date>2015-12-17T16:09:19Z</dc:date>
    <item>
      <title>Why am I getting "Error in 'eval' command: The expression is malformed. Expected )."</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Error-in-eval-command-The-expression-is/m-p/283446#M85657</link>
      <description>&lt;P&gt;&lt;STRONG&gt;Instance_ID&lt;/STRONG&gt; is one extracted field in code &lt;CODE&gt;*&lt;/CODE&gt;.  If there is a value in the &lt;CODE&gt;$ID$&lt;/CODE&gt; field, then result should list only for that value, else as default, it should display results for all values (for all values, I am trying &lt;CODE&gt;*&lt;/CODE&gt; to tmp)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Code *|eval tmp="$ID$" | eval tmp=if(isnull(tmp),"*",tmp |search Instance_ID =  tmp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Dec 2015 07:57:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Error-in-eval-command-The-expression-is/m-p/283446#M85657</guid>
      <dc:creator>sunil_bansal</dc:creator>
      <dc:date>2015-12-17T07:57:13Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting "Error in 'eval' command: The expression is malformed. Expected )."</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Error-in-eval-command-The-expression-is/m-p/283447#M85658</link>
      <description>&lt;P&gt;There seems to be a typo in your code and you need to use "where" instead of "search" when comparing fields:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Code |eval tmp="$ID$" | eval tmp=if(isnull(tmp),"",tmp) | where Instance_ID = tmp
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can also use the match operator. See &lt;A href="https://answers.splunk.com/answers/54063/compare-fields-for-like-match.html"&gt;this&lt;/A&gt; post&lt;/P&gt;</description>
      <pubDate>Thu, 17 Dec 2015 16:09:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Error-in-eval-command-The-expression-is/m-p/283447#M85658</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2015-12-17T16:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting "Error in 'eval' command: The expression is malformed. Expected )."</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Error-in-eval-command-The-expression-is/m-p/283448#M85659</link>
      <description>&lt;P&gt;The error is telling you that you are missing an end parenthesis in your &lt;CODE&gt;eval&lt;/CODE&gt; command. So, just add one in, like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; Code *|eval tmp="$ID$" | eval tmp=if(isnull(tmp),"*",tmp) |search Instance_ID =  tmp
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 17 Dec 2015 18:18:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-quot-Error-in-eval-command-The-expression-is/m-p/283448#M85659</guid>
      <dc:creator>masonmorales</dc:creator>
      <dc:date>2015-12-17T18:18:19Z</dc:date>
    </item>
  </channel>
</rss>

