<?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: eval wildcards in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-wildcards/m-p/31079#M6400</link>
    <description>&lt;P&gt;It did work.  Thank you very much!&lt;/P&gt;</description>
    <pubDate>Fri, 10 Aug 2012 15:21:44 GMT</pubDate>
    <dc:creator>gnovak</dc:creator>
    <dc:date>2012-08-10T15:21:44Z</dc:date>
    <item>
      <title>eval wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-wildcards/m-p/31077#M6398</link>
      <description>&lt;P&gt;I have a search that uses some wildcards:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="EPPWEB" source="/opt/log/*/web_server/info.log" WAT 
| rex field=_raw "USER (?P&amp;lt;registrar&amp;gt;\[\d+-\w\w\]) downloading .*/(?&amp;lt;filename&amp;gt;.+?)$" 
| search filename=Invoice.pdf OR filename=Statement.pdf OR filename=text.txt OR filename=*-*.pdf OR filename=*-*_invoice.html NOT filename=*-*_*.pdf 
| eval Actual=case(filename="Statement.pdf","Billing Statement",
                   filename="Invoice.pdf","Billing Invoice",
                   filename="text.txt","Billing Text",
                   filename="*-*.pdf","Scorecard",
                   filename="*-*_invoice.html","Drilldown Invoice")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You'll notice at the end of my eval command I used wildcards for the filenames.  However, when I run this search the 2 filenames I identified in the eval command that are using wildcards will NOT show up in the Actual field.  They show up as events and I can clearly see a line from the logs containing these filenames, but they aren't being assigned the filename I specified in the eval command.&lt;/P&gt;

&lt;P&gt;Does eval not like wildcards???&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2012 21:25:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-wildcards/m-p/31077#M6398</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2012-08-09T21:25:19Z</dc:date>
    </item>
    <item>
      <title>Re: eval wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-wildcards/m-p/31078#M6399</link>
      <description>&lt;P&gt;No, eval does not like wildcards. And you should also be using == instead of = in your case statement. Try the match function to deal with wildcards explicitly - but remember that match uses regular expressions.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="EPPWEB" source="/opt/log/*/web_server/info.log" WAT 
| rex field=_raw "USER (?P&amp;lt;registrar&amp;gt;\[\d+-\w\w\]) downloading .*/(?&amp;lt;filename&amp;gt;.+?)$" 
| search filename=Invoice.pdf OR filename=Statement.pdf OR filename=text.txt OR filename=*-*.pdf OR filename=*-*_invoice.html NOT filename=*-*_*.pdf 
| eval Actual=case(filename=="Statement.pdf","Billing Statement",
                   filename=="Invoice.pdf","Billing Invoice",
                   filename=="text.txt","Billing Text",
                   match(filename,".*-.*\.pdf$"),"Scorecard",
                   match(filename,".*-.*_invoice\.html$"),"Drilldown Invoice")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This may work. Please comment if it doesn't!&lt;/P&gt;</description>
      <pubDate>Thu, 09 Aug 2012 22:04:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-wildcards/m-p/31078#M6399</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-08-09T22:04:51Z</dc:date>
    </item>
    <item>
      <title>Re: eval wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-wildcards/m-p/31079#M6400</link>
      <description>&lt;P&gt;It did work.  Thank you very much!&lt;/P&gt;</description>
      <pubDate>Fri, 10 Aug 2012 15:21:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-wildcards/m-p/31079#M6400</guid>
      <dc:creator>gnovak</dc:creator>
      <dc:date>2012-08-10T15:21:44Z</dc:date>
    </item>
    <item>
      <title>Re: eval wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-wildcards/m-p/31080#M6401</link>
      <description>&lt;P&gt;Hi, sorry for downvote misclick. I look at it again and match function is very useful.&lt;/P&gt;</description>
      <pubDate>Tue, 14 Jul 2015 20:14:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-wildcards/m-p/31080#M6401</guid>
      <dc:creator>psciegienny</dc:creator>
      <dc:date>2015-07-14T20:14:20Z</dc:date>
    </item>
    <item>
      <title>Re: eval wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-wildcards/m-p/31081#M6402</link>
      <description>&lt;P&gt;Worked for me as well, thank you!&lt;/P&gt;</description>
      <pubDate>Thu, 22 Sep 2016 21:13:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-wildcards/m-p/31081#M6402</guid>
      <dc:creator>rfiscus</dc:creator>
      <dc:date>2016-09-22T21:13:23Z</dc:date>
    </item>
    <item>
      <title>Re: eval wildcards</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-wildcards/m-p/31082#M6403</link>
      <description>&lt;P&gt;worked!!&lt;BR /&gt;
Thanks. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 20 Oct 2017 04:45:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-wildcards/m-p/31082#M6403</guid>
      <dc:creator>smitra_splunk</dc:creator>
      <dc:date>2017-10-20T04:45:11Z</dc:date>
    </item>
  </channel>
</rss>

