<?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: Regex to start with specific characters in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-start-with-specific-characters/m-p/51216#M12348</link>
    <description>&lt;P&gt;Thank you  Kristian. the pattern i gave is uri and it always starts with / so that is why i had ^. So if i wanted to start with should i just add ^ at the beginning for the regex expression.  &lt;/P&gt;

&lt;P&gt;When i use the regex you have given, i am getting &lt;/P&gt;

&lt;P&gt;/mobile/m/shared/css/global.css&lt;BR /&gt;
/js/grainger/addtocartajax.js&lt;/P&gt;

&lt;P&gt;which is not the format i am looking for (/B387_38.css or&lt;BR /&gt;
/Globalfile.js). Do you know what to change?&lt;/P&gt;</description>
    <pubDate>Thu, 30 May 2013 18:56:12 GMT</pubDate>
    <dc:creator>xvxt006</dc:creator>
    <dc:date>2013-05-30T18:56:12Z</dc:date>
    <item>
      <title>Regex to start with specific characters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-start-with-specific-characters/m-p/51213#M12345</link>
      <description>&lt;P&gt;Hi, i would like to get all the requests that start with / and there will be few alpha numeric characters and then ends with .css or .js, etc.&lt;/P&gt;

&lt;P&gt;i have tried &lt;CODE&gt;^/*.(css|js)&lt;/CODE&gt; but did not work. Any suggestions? &lt;/P&gt;

&lt;P&gt;Sample requests&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/B387_38.css
/Globalfile.js
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 30 May 2013 16:54:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-start-with-specific-characters/m-p/51213#M12345</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2013-05-30T16:54:10Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to start with specific characters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-start-with-specific-characters/m-p/51214#M12346</link>
      <description>&lt;P&gt;Well, you probably should &lt;EM&gt;not&lt;/EM&gt; start the regex with a caret (^), unless you want to start your matching from the very beginning of the event. Also, there seems to be some confusion regarding regex wildcard characters.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;*&lt;/CODE&gt; = match the preceding character zero or more times&lt;BR /&gt;
&lt;CODE&gt;.&lt;/CODE&gt; = match any character (once)&lt;/P&gt;

&lt;P&gt;"slash, followed by a few alphanums, followed by dot, followed by either &lt;CODE&gt;css&lt;/CODE&gt; or &lt;CODE&gt;js&lt;/CODE&gt;" would look like;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/[A-Za-z0-9]+\.(js|css)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;if you also want underscore to match in the filename, you can actually shorten the expression &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;/\w+\.(js|css)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Note, if you want to use the &lt;CODE&gt;regex&lt;/CODE&gt; search command, you might need to specify more things, like a field to operate on, or quoting.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/Regex"&gt;http://docs.splunk.com/Documentation/Splunk/5.0.3/SearchReference/Regex&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2013 17:32:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-start-with-specific-characters/m-p/51214#M12346</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-05-30T17:32:40Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to start with specific characters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-start-with-specific-characters/m-p/51215#M12347</link>
      <description>&lt;P&gt;OOPS. A typo in the regexs. Fixed that now.&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2013 17:37:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-start-with-specific-characters/m-p/51215#M12347</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-05-30T17:37:31Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to start with specific characters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-start-with-specific-characters/m-p/51216#M12348</link>
      <description>&lt;P&gt;Thank you  Kristian. the pattern i gave is uri and it always starts with / so that is why i had ^. So if i wanted to start with should i just add ^ at the beginning for the regex expression.  &lt;/P&gt;

&lt;P&gt;When i use the regex you have given, i am getting &lt;/P&gt;

&lt;P&gt;/mobile/m/shared/css/global.css&lt;BR /&gt;
/js/grainger/addtocartajax.js&lt;/P&gt;

&lt;P&gt;which is not the format i am looking for (/B387_38.css or&lt;BR /&gt;
/Globalfile.js). Do you know what to change?&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2013 18:56:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-start-with-specific-characters/m-p/51216#M12348</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2013-05-30T18:56:12Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to start with specific characters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-start-with-specific-characters/m-p/51217#M12349</link>
      <description>&lt;P&gt;Add the initial caret.&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2013 19:57:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-start-with-specific-characters/m-p/51217#M12349</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2013-05-30T19:57:36Z</dc:date>
    </item>
    <item>
      <title>Re: Regex to start with specific characters</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-to-start-with-specific-characters/m-p/51218#M12350</link>
      <description>&lt;P&gt;yep, if you use a field to operate on, the caret is relative to the field value.&lt;/P&gt;</description>
      <pubDate>Thu, 30 May 2013 21:01:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-to-start-with-specific-characters/m-p/51218#M12350</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2013-05-30T21:01:02Z</dc:date>
    </item>
  </channel>
</rss>

