<?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: Problem with case statement using eval in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-case-statement-using-eval/m-p/399023#M115684</link>
    <description>&lt;P&gt;Thank you, I feel dumb now. &lt;/P&gt;</description>
    <pubDate>Thu, 04 Apr 2019 19:07:04 GMT</pubDate>
    <dc:creator>selinakvle</dc:creator>
    <dc:date>2019-04-04T19:07:04Z</dc:date>
    <item>
      <title>Problem with case statement using eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-case-statement-using-eval/m-p/399020#M115681</link>
      <description>&lt;P&gt;Hi all,&lt;/P&gt;

&lt;P&gt;Getting this error:&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Error in 'eval' command: The expression is malformed. Expected ).&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;I'm following the following tutorial:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://www.splunk.com/blog/2017/06/01/enhancing-splunk-visualizations-with-mapbox.html"&gt;https://www.splunk.com/blog/2017/06/01/enhancing-splunk-visualizations-with-mapbox.html&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Everything was going fine until I got to the part of the search where I had to add the eval case statement color parameters.  Can someone tell me where I'm going wrong?  Thanks!&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="test" severity="critical" | iplocation src prefix=start_ | iplocation dest prefix=end_ | search start_Country="*" end_Country="*" | table start_lat start_lon end_lat end_lon app | eval animate="yes", pulse_at_start="yes" | eval color = case (
match(app, "ssh"), "#c0392b"
    match(app, "web-browsing"), "#e67e22",
    match(app, "unknown-tcp"), "#f1c40f",
    match(app, "webdav"), "#27ae60",
    1==1, "#7f8c8d")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;It doesn't look like I'm missing anything..but then again..Its always better with another set of eyes:)&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 17:09:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-case-statement-using-eval/m-p/399020#M115681</guid>
      <dc:creator>selinakvle</dc:creator>
      <dc:date>2019-04-04T17:09:22Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with case statement using eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-case-statement-using-eval/m-p/399021#M115682</link>
      <description>&lt;P&gt;Missing a comma after first match, this should help&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="test" severity="critical" 
    | iplocation src prefix=start_ 
    | iplocation dest prefix=end_ 
    | search start_Country="*" end_Country="*" 
    | table start_lat start_lon end_lat end_lon app 
    | eval animate="yes", pulse_at_start="yes" 
    | eval color = case (
        match(app, "ssh"), "#c0392b",
        match(app, "web-browsing"), "#e67e22",
        match(app, "unknown-tcp"), "#f1c40f",
        match(app, "webdav"), "#27ae60",
        1==1, "#7f8c8d")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Additionally, one useful thing for formatting your queries, if you press CTRL and \ at the same time while in the search window, your query gets automatically formatted to be readable, try it out, it makes troubleshooting queries a lot easier.&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 17:16:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-case-statement-using-eval/m-p/399021#M115682</guid>
      <dc:creator>martinpu</dc:creator>
      <dc:date>2019-04-04T17:16:37Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with case statement using eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-case-statement-using-eval/m-p/399022#M115683</link>
      <description>&lt;P&gt;You're missing a comma on line 2. Fix that and it will work&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 17:50:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-case-statement-using-eval/m-p/399022#M115683</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2019-04-04T17:50:07Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with case statement using eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-case-statement-using-eval/m-p/399023#M115684</link>
      <description>&lt;P&gt;Thank you, I feel dumb now. &lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 19:07:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-case-statement-using-eval/m-p/399023#M115684</guid>
      <dc:creator>selinakvle</dc:creator>
      <dc:date>2019-04-04T19:07:04Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with case statement using eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-case-statement-using-eval/m-p/399024#M115685</link>
      <description>&lt;P&gt;Thank you...&lt;EM&gt;face palm&lt;/EM&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 19:07:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-case-statement-using-eval/m-p/399024#M115685</guid>
      <dc:creator>selinakvle</dc:creator>
      <dc:date>2019-04-04T19:07:20Z</dc:date>
    </item>
    <item>
      <title>Re: Problem with case statement using eval</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Problem-with-case-statement-using-eval/m-p/399025#M115686</link>
      <description>&lt;P&gt;No need to feel dumb, everyone goes through this and understands the &lt;CODE&gt;missing parenthesis&lt;/CODE&gt; error message doesn't always mean the parenthesis are missing &lt;/P&gt;</description>
      <pubDate>Thu, 04 Apr 2019 19:23:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Problem-with-case-statement-using-eval/m-p/399025#M115686</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2019-04-04T19:23:34Z</dc:date>
    </item>
  </channel>
</rss>

