<?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 file name after space in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296946#M3779</link>
    <description>&lt;P&gt;Great. Thanks.&lt;/P&gt;</description>
    <pubDate>Thu, 29 Mar 2018 11:01:54 GMT</pubDate>
    <dc:creator>jacqu3sy</dc:creator>
    <dc:date>2018-03-29T11:01:54Z</dc:date>
    <item>
      <title>Regex file name after space</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296939#M3772</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;Regex wimp here...&lt;/P&gt;

&lt;P&gt;I need to extract the file name after the word detected fro ma _raw event. &lt;/P&gt;

&lt;P&gt;Example of _raw log;&lt;/P&gt;

&lt;P&gt;change to a file has been detected /etc/fileinquestion.conf&lt;/P&gt;

&lt;P&gt;I've tried the following but it errors;&lt;/P&gt;

&lt;P&gt;| rex field=_raw "detected\s*(?*)"&lt;/P&gt;

&lt;P&gt;Any helps appreciated. Thanks.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:43:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296939#M3772</guid>
      <dc:creator>jacqu3sy</dc:creator>
      <dc:date>2020-09-29T18:43:57Z</dc:date>
    </item>
    <item>
      <title>Re: Regex file name after space</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296940#M3773</link>
      <description>&lt;P&gt;Hi can you try:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    | rex field=_raw "detected\s*(?P&amp;lt;filename&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Mar 2018 09:58:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296940#M3773</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-03-29T09:58:23Z</dc:date>
    </item>
    <item>
      <title>Re: Regex file name after space</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296941#M3774</link>
      <description>&lt;P&gt;Considering that your message might vary the part before the file name, i think you should use a negative lookahead style, like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; | rex field=_raw "(?=\/)(?P&amp;lt;filename&amp;gt;.*)"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 29 Mar 2018 10:08:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296941#M3774</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-29T10:08:08Z</dc:date>
    </item>
    <item>
      <title>Re: Regex file name after space</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296942#M3775</link>
      <description>&lt;P&gt;It works, but I'm not sure how!? Would you mind explaining what the (?=\/) achieves? &lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 10:31:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296942#M3775</guid>
      <dc:creator>jacqu3sy</dc:creator>
      <dc:date>2018-03-29T10:31:29Z</dc:date>
    </item>
    <item>
      <title>Re: Regex file name after space</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296943#M3776</link>
      <description>&lt;P&gt;Worked a treat. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 10:31:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296943#M3776</guid>
      <dc:creator>jacqu3sy</dc:creator>
      <dc:date>2018-03-29T10:31:41Z</dc:date>
    </item>
    <item>
      <title>Re: Regex file name after space</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296944#M3777</link>
      <description>&lt;P&gt;It says to the regex processor to not capture anything until it finds the /.&lt;/P&gt;

&lt;P&gt;It is more agile than assuming the logs always have the word "detected". But it's up to your specific scenario though.&lt;/P&gt;

&lt;P&gt;If it suits you, please upvote the answer as it is a valid option &lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 10:39:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296944#M3777</guid>
      <dc:creator>tiagofbmm</dc:creator>
      <dc:date>2018-03-29T10:39:14Z</dc:date>
    </item>
    <item>
      <title>Re: Regex file name after space</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296945#M3778</link>
      <description>&lt;P&gt;Please accept answer if its helpful.. &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 10:39:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296945#M3778</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-03-29T10:39:32Z</dc:date>
    </item>
    <item>
      <title>Re: Regex file name after space</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296946#M3779</link>
      <description>&lt;P&gt;Great. Thanks.&lt;/P&gt;</description>
      <pubDate>Thu, 29 Mar 2018 11:01:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Regex-file-name-after-space/m-p/296946#M3779</guid>
      <dc:creator>jacqu3sy</dc:creator>
      <dc:date>2018-03-29T11:01:54Z</dc:date>
    </item>
  </channel>
</rss>

