<?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 an error in 'eval' command &amp;quot;The expression is malformed. Expected ). No missing Parenthesis&amp;quot;? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378114#M168065</link>
    <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;I found two errors in your search query. &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;You have an extra closing &lt;CODE&gt;)&lt;/CODE&gt; in the 6th eval statement - &lt;CODE&gt;| eval PROD = if("TAF-P"==substr(Computer,1,5),Duration,0))&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;You have an extra closing &lt;CODE&gt;)&lt;/CODE&gt; in the 8th eval statement - &lt;CODE&gt;| eval SP = if("TAF-SP"==substr(Computer,1,6)),Duration,0)&lt;/CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
    <pubDate>Fri, 27 Jul 2018 18:45:56 GMT</pubDate>
    <dc:creator>sudosplunk</dc:creator>
    <dc:date>2018-07-27T18:45:56Z</dc:date>
    <item>
      <title>Why am I getting an error in 'eval' command "The expression is malformed. Expected ). No missing Parenthesis"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378113#M168064</link>
      <description>&lt;P&gt;I have double and triple checked for parenthesis and found no issues with the code.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;VM Usage&amp;lt;/title&amp;gt;
      &amp;lt;input type="dropdown" token="TimeRange" searchWhenChanged="true"&amp;gt;
        &amp;lt;label&amp;gt;Select a Time Range for the X-axis:&amp;lt;/label&amp;gt;
        &amp;lt;choice value="-7d@d"&amp;gt;last 7 days&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="-30d@d"&amp;gt;last 30 days&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="-12mon@mon"&amp;gt;last 12 months&amp;lt;/choice&amp;gt;
        &amp;lt;default&amp;gt;-7d@d&amp;lt;/default&amp;gt;
        &amp;lt;initialValue&amp;gt;-7d@d&amp;lt;/initialValue&amp;gt;
      &amp;lt;/input&amp;gt;
      &amp;lt;input type="dropdown" token="VMtype" searchWhenChanged="true"&amp;gt;
        &amp;lt;label&amp;gt;Select a VM type:&amp;lt;/label&amp;gt;
        &amp;lt;default&amp;gt;ALL&amp;lt;/default&amp;gt;
        &amp;lt;choice value="sum(BTD) as BTD,sum(PROD) as PROD, sum(SUP) as SUP, sum(SP) as SurePayroll, first(BTDthreshold) as BTDMAX, first(Prodthreshold) as PRODMAX, first(SUPthreshold) as SUPMAX, first(SPthreshold) as SPMAX"&amp;gt;ALL&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="sum(BTD) as BTD, first(BTDthreshold) as BTDMAX"&amp;gt;BTD&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="sum(PROD) as PROD, first(Prodthreshold) as PRODMAX"&amp;gt;PROD&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="sum(SUP) as SUP, first(SUPthreshold) as SUPMAX"&amp;gt;SUP&amp;lt;/choice&amp;gt;
        &amp;lt;choice value="sum(SP) as SurePayroll, first(SPthreshold) as SPMAX"&amp;gt;Sure Payroll&amp;lt;/choice&amp;gt;
      &amp;lt;/input&amp;gt;
      &amp;lt;chart&amp;gt;
        &amp;lt;title&amp;gt;VM usage (Bars = Total test durations, Lines = Max capacity of VM type)&amp;lt;/title&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=taf sourcetype=dbmon source=PROD_host_TAFPRODLSNR_db_AutomationDW_ExecutionHistory ExecutedByUser="PAYCHEX\\TafRunProd"|eval MONTH=strftime(_time,"%m")|eval DAY = strftime(_time,"%d")|
eval time = if(match($TimeRange$,"-12mon@mon"),MONTH,DAY) |eval Duration=round(Duration/600000000,1)|
eval BTD = if("TAF-BTD"==substr(Computer,1,7),Duration,0)|eval PROD = if("TAF-P"==substr(Computer,1,5),Duration,0))|eval SUP = if("TAF-SUP"==substr(Computer,1,7),Duration,0)|eval SP = if("TAF-SP"==substr(Computer,1,6)),Duration,0)|
eval VMMAX = if(match($TimeRange$,"-12mon@mon"),17280,1440)|eval BTDthreshold = 70*VMMAX|eval Prodthreshold = 115*VMMAX|eval SUPthreshold = 65*VMMAX|eval SPthreshold = 23*VMMAX|
stats $VMtype$ by time&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;$TimeRange$&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="charting.axisTitleY.text"&amp;gt;Duration (min)&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart"&amp;gt;column&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.chart.overlayFields"&amp;gt;BTDMAX,PRODMAX,SUPMAX,SPMAX&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="charting.fieldColors"&amp;gt;{"BTDMAX":0xcc0000,"BTD":0xcc0000,"PRODMAX":0x009900,"PROD":0x009900,"SUPMAX":0x0000FF,"SUP":0x0000FF,"SPMAX":0xFF9900,"SurePayroll":0xFF9900}&amp;lt;/option&amp;gt;
      &amp;lt;/chart&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Jul 2018 18:31:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378113#M168064</guid>
      <dc:creator>cacampbe</dc:creator>
      <dc:date>2018-07-27T18:31:35Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error in 'eval' command "The expression is malformed. Expected ). No missing Parenthesis"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378114#M168065</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;I found two errors in your search query. &lt;/P&gt;

&lt;OL&gt;
&lt;LI&gt;You have an extra closing &lt;CODE&gt;)&lt;/CODE&gt; in the 6th eval statement - &lt;CODE&gt;| eval PROD = if("TAF-P"==substr(Computer,1,5),Duration,0))&lt;/CODE&gt;&lt;/LI&gt;
&lt;LI&gt;You have an extra closing &lt;CODE&gt;)&lt;/CODE&gt; in the 8th eval statement - &lt;CODE&gt;| eval SP = if("TAF-SP"==substr(Computer,1,6)),Duration,0)&lt;/CODE&gt;&lt;/LI&gt;
&lt;/OL&gt;</description>
      <pubDate>Fri, 27 Jul 2018 18:45:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378114#M168065</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-07-27T18:45:56Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error in 'eval' command "The expression is malformed. Expected ). No missing Parenthesis"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378115#M168066</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;try below query,&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=taf sourcetype=dbmon source=PROD_host_TAFPRODLSNR_db_AutomationDW_ExecutionHistory ExecutedByUser="PAYCHEX\\TafRunProd"
|eval MONTH=strftime(_time,"%m"),DAY = strftime(_time,"%d"),time = if(match($TimeRange$,"-12mon@mon"),MONTH,DAY),Duration=round(Duration/600000000,1),BTD = if("TAF-BTD"==substr(Computer,1,7),Duration,0),PROD = if("TAF-P"==substr(Computer,1,5),Duration,0),SUP = if("TAF-SUP"==substr(Computer,1,7),Duration,0),SP = if("TAF-SP"==substr(Computer,1,6),Duration,0),VMMAX = if(match($TimeRange$,"-12mon@mon"),17280,1440),BTDthreshold = 70*VMMAX,Prodthreshold = 115*VMMAX,SUPthreshold = 65*VMMAX,SPthreshold = 23*VMMAX
| stats $VMtype$ by time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Jul 2018 18:47:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378115#M168066</guid>
      <dc:creator>thambisetty</dc:creator>
      <dc:date>2018-07-27T18:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error in 'eval' command "The expression is malformed. Expected ). No missing Parenthesis"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378116#M168067</link>
      <description>&lt;P&gt;If the TimeRange token has string value, then put it in double quotes in eval, like this (couple of eval-match )&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=taf sourcetype=dbmon source=PROD_host_TAFPRODLSNR_db_AutomationDW_ExecutionHistory ExecutedByUser="PAYCHEX\\TafRunProd"|eval MONTH=strftime(_time,"%m")|eval DAY = strftime(_time,"%d")|
 eval time = if(match("$TimeRange$","-12mon@mon"),MONTH,DAY) |eval Duration=round(Duration/600000000,1)|
 eval BTD = if("TAF-BTD"==substr(Computer,1,7),Duration,0)|eval PROD = if("TAF-P"==substr(Computer,1,5),Duration,0))|eval SUP = if("TAF-SUP"==substr(Computer,1,7),Duration,0)|eval SP = if("TAF-SP"==substr(Computer,1,6)),Duration,0)|
 eval VMMAX = if(match("$TimeRange$","-12mon@mon"),17280,1440)|eval BTDthreshold = 70*VMMAX|eval Prodthreshold = 115*VMMAX|eval SUPthreshold = 65*VMMAX|eval SPthreshold = 23*VMMAX|
 stats $VMtype$ by time
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Jul 2018 18:47:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378116#M168067</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-07-27T18:47:41Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error in 'eval' command "The expression is malformed. Expected ). No missing Parenthesis"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378117#M168068</link>
      <description>&lt;P&gt;Thanks, in my efforts to solve it myself I had added extra ) because I was losing my mind, and forgot a couple when taking them back out.&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 18:51:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378117#M168068</guid>
      <dc:creator>cacampbe</dc:creator>
      <dc:date>2018-07-27T18:51:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error in 'eval' command "The expression is malformed. Expected ). No missing Parenthesis"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378118#M168069</link>
      <description>&lt;P&gt;That fixed it! thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 18:51:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378118#M168069</guid>
      <dc:creator>cacampbe</dc:creator>
      <dc:date>2018-07-27T18:51:40Z</dc:date>
    </item>
    <item>
      <title>Re: Why am I getting an error in 'eval' command "The expression is malformed. Expected ). No missing Parenthesis"?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378119#M168070</link>
      <description>&lt;P&gt;I see ya. I've been there couple of times:)&lt;BR /&gt;
Happy Splunking!&lt;/P&gt;</description>
      <pubDate>Fri, 27 Jul 2018 18:54:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-an-error-in-eval-command-quot-The-expression-is/m-p/378119#M168070</guid>
      <dc:creator>sudosplunk</dc:creator>
      <dc:date>2018-07-27T18:54:41Z</dc:date>
    </item>
  </channel>
</rss>

