<?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: Help with eval and wildcards in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Help-with-eval-and-wildcards/m-p/407755#M117755</link>
    <description>&lt;P&gt;Hi @a212830,&lt;BR /&gt;
try to use like instead match&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=sensor_info 
| eval IDSGROUP = case(like(host,"az%"), "Tuscon RIG", like(host,"bos%"), "Boston RIG", like(host,"tx%"), "DFW RIG", like(host,"ca%"), "LAX RIG")
| timechart avg(pkt_drop_percent) by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
    <pubDate>Fri, 26 Jul 2019 14:06:45 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2019-07-26T14:06:45Z</dc:date>
    <item>
      <title>Help with eval and wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-eval-and-wildcards/m-p/407754#M117754</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I'm trying to use eval for hosts, and need to use wildcards.  I tried the following, but it's not working.   How does eval handle wildcards?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=sensor_info 
| eval IDSGROUP = case(match(host==az*, "Tuscon RIG", host==bos*, "Boston RIG", host==tx*, "DFW RIG", host==ca*, "LAX RIG"))
| timechart avg(pkt_drop_percent) by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Jul 2019 13:55:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-eval-and-wildcards/m-p/407754#M117754</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2019-07-26T13:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Help with eval and wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-eval-and-wildcards/m-p/407755#M117755</link>
      <description>&lt;P&gt;Hi @a212830,&lt;BR /&gt;
try to use like instead match&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=main sourcetype=sensor_info 
| eval IDSGROUP = case(like(host,"az%"), "Tuscon RIG", like(host,"bos%"), "Boston RIG", like(host,"tx%"), "DFW RIG", like(host,"ca%"), "LAX RIG")
| timechart avg(pkt_drop_percent) by host
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 14:06:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-eval-and-wildcards/m-p/407755#M117755</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-07-26T14:06:45Z</dc:date>
    </item>
    <item>
      <title>Re: Help with eval and wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-eval-and-wildcards/m-p/407756#M117756</link>
      <description>&lt;P&gt;Thanks! !!&lt;/P&gt;</description>
      <pubDate>Fri, 26 Jul 2019 15:39:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-eval-and-wildcards/m-p/407756#M117756</guid>
      <dc:creator>a212830</dc:creator>
      <dc:date>2019-07-26T15:39:33Z</dc:date>
    </item>
    <item>
      <title>Re: Help with eval and wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-eval-and-wildcards/m-p/407757#M117757</link>
      <description>&lt;P&gt;You're welcome!&lt;BR /&gt;
Bye.&lt;BR /&gt;
Giuseppe&lt;/P&gt;</description>
      <pubDate>Sat, 27 Jul 2019 14:52:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-eval-and-wildcards/m-p/407757#M117757</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2019-07-27T14:52:16Z</dc:date>
    </item>
    <item>
      <title>Re: Help with eval and wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Help-with-eval-and-wildcards/m-p/407758#M117758</link>
      <description>&lt;P&gt;First you need to have your pattern wrapped in quotes.&lt;/P&gt;

&lt;P&gt;Two, you need to use match() properly.&lt;/P&gt;

&lt;P&gt;Then you need to fix your regex. &lt;/P&gt;

&lt;P&gt;You probably want something like &lt;CODE&gt;case(match(host,”az.*”),”Tuscon”,match(host,”bos.*”),”Boston”)&lt;/CODE&gt; for a shortened example&lt;/P&gt;</description>
      <pubDate>Mon, 29 Jul 2019 03:00:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Help-with-eval-and-wildcards/m-p/407758#M117758</guid>
      <dc:creator>twinspop</dc:creator>
      <dc:date>2019-07-29T03:00:36Z</dc:date>
    </item>
  </channel>
</rss>

