<?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: How do we use wildcard such as * in eval case match to see multiple types of files? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351477#M104035</link>
    <description>&lt;P&gt;The match function in eval doesn't treat asterisk &lt;CODE&gt;*&lt;/CODE&gt; as wildcard character but as regular expression. So the match fails. Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= | eval FileType=case(match(fileName,"ABC01.GIF"),"ABC01.GIF*" , match(fileName,"ABC02.DCL.*.GIF.*"),"ABC02.DCL*.GIF*", match(fileName,"ABC03.IFG_DCL.*.GIF.*"),"ABC03.IFG_DCL*.GIF*", match(fileName,"ABC04.FGH_HCL.*.DAT.*"),"ABC04.FGH_HCL*.DAT*", match(fileName,"ABC05.FGH_OUT.*.DAT.*"), "ABC05.FGH_OUT*.DAT*", match(fileName,"ABC06.GHI_OUT_DAILY.*.DAT.*"), "ABC06.GHI_OUT_DAILY*.DAT*") | stats count by FileType
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 20 Sep 2017 15:28:44 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2017-09-20T15:28:44Z</dc:date>
    <item>
      <title>How do we use wildcard such as * in eval case match to see multiple types of files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351474#M104032</link>
      <description>&lt;P&gt;I was trying to give all the 6 types of files which are under fileName field and trying to get all the filetypes including * under FileType field. but with the below search i am not able to pull all 6types of files under FileType field. &lt;/P&gt;

&lt;P&gt;Trying this search:&lt;BR /&gt;
index=* | eval FileType=case(match(fileName,"ABC01.GIF*"),"ABC01.GIF*" , match(fileName,"ABC02.DCL*.GIF*"),"ABC02.DCL*.GIF*", match(fileName,"ABC03.IFG_DCL*.GIF*"),"ABC03.IFG_DCL*.GIF*", match(fileName,"ABC04.FGH_HCL*.DAT*"),"ABC04.FGH_HCL*.DAT*", match(fileName,"ABC05.FGH_OUT*.DAT*"), "ABC05.FGH_OUT*.DAT*",  match(fileName,"ABC06.GHI_OUT_DAILY*.DAT*"), "ABC06.GHI_OUT_DAILY*.DAT*") | stats count by FileType&lt;/P&gt;

&lt;P&gt;Please advise to get all types of files under FileType field.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:53:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351474#M104032</guid>
      <dc:creator>sai_john</dc:creator>
      <dc:date>2020-09-29T15:53:29Z</dc:date>
    </item>
    <item>
      <title>Re: How do we use wildcard such as * in eval case match to see multiple types of files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351475#M104033</link>
      <description>&lt;P&gt;My result values under FileType should be &lt;BR /&gt;
FileType&lt;BR /&gt;
"ABC01.GIF*"&lt;BR /&gt;
"ABC02.DCL*.GIF*"&lt;BR /&gt;
"ABC03.IFG_DCL*.GIF*"&lt;BR /&gt;
"ABC04.FGH_HCL*.DAT*"&lt;BR /&gt;
"ABC05.FGH_OUT*.DAT*"&lt;BR /&gt;
"ABC06.GHI_OUT_DAILY*.DAT*"&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 15:53:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351475#M104033</guid>
      <dc:creator>sai_john</dc:creator>
      <dc:date>2020-09-29T15:53:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do we use wildcard such as * in eval case match to see multiple types of files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351476#M104034</link>
      <description>&lt;P&gt;try this &lt;/P&gt;

&lt;P&gt;\*&lt;/P&gt;

&lt;P&gt;or&lt;/P&gt;

&lt;P&gt;| rex mode=sed "/*/ash/" | rest of the query instead of \* use ash&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 14:27:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351476#M104034</guid>
      <dc:creator>sbbadri</dc:creator>
      <dc:date>2017-09-20T14:27:31Z</dc:date>
    </item>
    <item>
      <title>Re: How do we use wildcard such as * in eval case match to see multiple types of files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351477#M104035</link>
      <description>&lt;P&gt;The match function in eval doesn't treat asterisk &lt;CODE&gt;*&lt;/CODE&gt; as wildcard character but as regular expression. So the match fails. Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index= | eval FileType=case(match(fileName,"ABC01.GIF"),"ABC01.GIF*" , match(fileName,"ABC02.DCL.*.GIF.*"),"ABC02.DCL*.GIF*", match(fileName,"ABC03.IFG_DCL.*.GIF.*"),"ABC03.IFG_DCL*.GIF*", match(fileName,"ABC04.FGH_HCL.*.DAT.*"),"ABC04.FGH_HCL*.DAT*", match(fileName,"ABC05.FGH_OUT.*.DAT.*"), "ABC05.FGH_OUT*.DAT*", match(fileName,"ABC06.GHI_OUT_DAILY.*.DAT.*"), "ABC06.GHI_OUT_DAILY*.DAT*") | stats count by FileType
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 20 Sep 2017 15:28:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351477#M104035</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-20T15:28:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do we use wildcard such as * in eval case match to see multiple types of files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351478#M104036</link>
      <description>&lt;P&gt;Hey @sai_john, if somesoni2's solution worked then please don't forget to accept their answer to award karma points and close the question. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 20 Sep 2017 19:54:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351478#M104036</guid>
      <dc:creator>lfedak_splunk</dc:creator>
      <dc:date>2017-09-20T19:54:22Z</dc:date>
    </item>
    <item>
      <title>Re: How do we use wildcard such as * in eval case match to see multiple types of files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351479#M104037</link>
      <description>&lt;P&gt;I tried giving .&lt;EM&gt;.&lt;/EM&gt; in between fileNames as you said but that is not working &lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 00:10:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351479#M104037</guid>
      <dc:creator>sai_john</dc:creator>
      <dc:date>2017-09-21T00:10:03Z</dc:date>
    </item>
    <item>
      <title>Re: How do we use wildcard such as * in eval case match to see multiple types of files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351480#M104038</link>
      <description>&lt;P&gt;Can you post some sample values of field fileName, especially the ones which are failing?&lt;/P&gt;</description>
      <pubDate>Thu, 21 Sep 2017 00:19:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351480#M104038</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-09-21T00:19:36Z</dc:date>
    </item>
    <item>
      <title>Re: How do we use wildcard such as * in eval case match to see multiple types of files?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351481#M104039</link>
      <description>&lt;P&gt;This worked. Thanks soni&lt;/P&gt;</description>
      <pubDate>Fri, 22 Sep 2017 12:40:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-we-use-wildcard-such-as-in-eval-case-match-to-see/m-p/351481#M104039</guid>
      <dc:creator>sai_john</dc:creator>
      <dc:date>2017-09-22T12:40:50Z</dc:date>
    </item>
  </channel>
</rss>

