<?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 eval - Error in 'eval' command: The expression is malformed. Expected ). in Monitoring Splunk</title>
    <link>https://community.splunk.com/t5/Monitoring-Splunk/eval-Error-in-eval-command-The-expression-is-malformed-Expected/m-p/459355#M5808</link>
    <description>&lt;P&gt;index=abc123 | eval app=case(application==Application_1,"app_id_1",application==Application_2,"app_id_2") | stats count by app&lt;/P&gt;

&lt;P&gt;This search returns: Error in 'eval' command: The expression is malformed. Expected ).&lt;BR /&gt;
Can you let me know what's wrong with my search ? Thank you&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 20:38:12 GMT</pubDate>
    <dc:creator>tnguyen125</dc:creator>
    <dc:date>2020-09-29T20:38:12Z</dc:date>
    <item>
      <title>eval - Error in 'eval' command: The expression is malformed. Expected ).</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/eval-Error-in-eval-command-The-expression-is-malformed-Expected/m-p/459355#M5808</link>
      <description>&lt;P&gt;index=abc123 | eval app=case(application==Application_1,"app_id_1",application==Application_2,"app_id_2") | stats count by app&lt;/P&gt;

&lt;P&gt;This search returns: Error in 'eval' command: The expression is malformed. Expected ).&lt;BR /&gt;
Can you let me know what's wrong with my search ? Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 20:38:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/eval-Error-in-eval-command-The-expression-is-malformed-Expected/m-p/459355#M5808</guid>
      <dc:creator>tnguyen125</dc:creator>
      <dc:date>2020-09-29T20:38:12Z</dc:date>
    </item>
    <item>
      <title>Re: eval - Error in 'eval' command: The expression is malformed. Expected ).</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/eval-Error-in-eval-command-The-expression-is-malformed-Expected/m-p/459356#M5809</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Your expression looks a bit weird in the question because you didn't use the code button and some symbols weren't escaped.&lt;BR /&gt;
In any case, you could try with something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=abc123 
| eval app=case (
    application=="Application_1", "app_id_1",
    application=="Application_2", "app_id_2",
    1==1, "other"
)
| stats count by app
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Which includes a matching for the two types of application names you want to match, but also a third option which is always true in case none of the previous matches work.&lt;/P&gt;

&lt;P&gt;Hope that helps&lt;BR /&gt;
J&lt;/P&gt;</description>
      <pubDate>Mon, 30 Jul 2018 07:55:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/eval-Error-in-eval-command-The-expression-is-malformed-Expected/m-p/459356#M5809</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2018-07-30T07:55:59Z</dc:date>
    </item>
    <item>
      <title>Re: eval - Error in 'eval' command: The expression is malformed. Expected ).</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/eval-Error-in-eval-command-The-expression-is-malformed-Expected/m-p/459357#M5810</link>
      <description>&lt;P&gt;Hi @tnguyen125, did the answer above help? If so, please don't forget to mark it as answered. If not please provide some feedback.&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 18:35:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/eval-Error-in-eval-command-The-expression-is-malformed-Expected/m-p/459357#M5810</guid>
      <dc:creator>javiergn</dc:creator>
      <dc:date>2018-08-07T18:35:50Z</dc:date>
    </item>
    <item>
      <title>Re: eval - Error in 'eval' command: The expression is malformed. Expected ).</title>
      <link>https://community.splunk.com/t5/Monitoring-Splunk/eval-Error-in-eval-command-The-expression-is-malformed-Expected/m-p/459358#M5811</link>
      <description>&lt;P&gt;Thank you&lt;/P&gt;</description>
      <pubDate>Tue, 07 Aug 2018 19:06:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Monitoring-Splunk/eval-Error-in-eval-command-The-expression-is-malformed-Expected/m-p/459358#M5811</guid>
      <dc:creator>tnguyen125</dc:creator>
      <dc:date>2018-08-07T19:06:26Z</dc:date>
    </item>
  </channel>
</rss>

