<?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 Splunk Regex Question in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Question/m-p/108647#M28299</link>
    <description>&lt;P&gt;I want to list all the file names in a log file in Splunk whose name ends with, "_bn.txt"&lt;/P&gt;

&lt;P&gt;Let's say the field name is path&lt;/P&gt;

&lt;P&gt;so my regex looks like&lt;/P&gt;

&lt;P&gt;regex path=".*_bn.txt$"&lt;/P&gt;

&lt;P&gt;However, this does not list down the results.&lt;/P&gt;

&lt;P&gt;But if I use the following regex:&lt;/P&gt;

&lt;P&gt;regex path=".*.txt$"&lt;/P&gt;

&lt;P&gt;I am able to see all the filenames which end in .txt.&lt;/P&gt;

&lt;P&gt;Need to find all the file names ending in, _bn.txt&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;

&lt;P&gt;PS: I don't think underscore is a metacharacter which needs to be escaped.&lt;/P&gt;</description>
    <pubDate>Thu, 26 Jul 2012 05:50:36 GMT</pubDate>
    <dc:creator>NeonFlash</dc:creator>
    <dc:date>2012-07-26T05:50:36Z</dc:date>
    <item>
      <title>Splunk Regex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Question/m-p/108647#M28299</link>
      <description>&lt;P&gt;I want to list all the file names in a log file in Splunk whose name ends with, "_bn.txt"&lt;/P&gt;

&lt;P&gt;Let's say the field name is path&lt;/P&gt;

&lt;P&gt;so my regex looks like&lt;/P&gt;

&lt;P&gt;regex path=".*_bn.txt$"&lt;/P&gt;

&lt;P&gt;However, this does not list down the results.&lt;/P&gt;

&lt;P&gt;But if I use the following regex:&lt;/P&gt;

&lt;P&gt;regex path=".*.txt$"&lt;/P&gt;

&lt;P&gt;I am able to see all the filenames which end in .txt.&lt;/P&gt;

&lt;P&gt;Need to find all the file names ending in, _bn.txt&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;

&lt;P&gt;PS: I don't think underscore is a metacharacter which needs to be escaped.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2012 05:50:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Question/m-p/108647#M28299</guid>
      <dc:creator>NeonFlash</dc:creator>
      <dc:date>2012-07-26T05:50:36Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Regex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Question/m-p/108648#M28300</link>
      <description>&lt;P&gt;Underscore is not a metacharacter, but the period is.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;regex path=".*_bn\.txt$"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;would be more accurate. But if there &lt;EM&gt;were&lt;/EM&gt; files that ended in &lt;CODE&gt;_bn.txt&lt;/CODE&gt;, the first regular expression still should have matched them...&lt;/P&gt;

&lt;P&gt;So are you sure that there are any file names ending in &lt;CODE&gt;_bn.txt&lt;/CODE&gt; in the time range that you are searching?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2012 06:54:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Question/m-p/108648#M28300</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2012-07-26T06:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Regex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Question/m-p/108649#M28301</link>
      <description>&lt;P&gt;Also, where are you getting the field name &lt;CODE&gt;path&lt;/CODE&gt; from? If you're talking about Splunk's field for showing the path of input files, that field's name is &lt;CODE&gt;source&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2012 07:03:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Question/m-p/108649#M28301</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-07-26T07:03:14Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Regex Question</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Question/m-p/108650#M28302</link>
      <description>&lt;P&gt;Hi, yes, the regex worked. For some reason when I ran the splunk query for the first time, it did not work. Yes, I escaped the metacharacter with a backslash. @Ayn: In my case the field name is different &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 26 Jul 2012 08:03:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Regex-Question/m-p/108650#M28302</guid>
      <dc:creator>NeonFlash</dc:creator>
      <dc:date>2012-07-26T08:03:45Z</dc:date>
    </item>
  </channel>
</rss>

