<?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: Drop everything after last occurrence of Symbol in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/What-regex-to-use-to-drop-everything-after-the-last-occurrence/m-p/620290#M215626</link>
    <description>&lt;P&gt;Try this command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed field=foo "s/(.*)\/.*?$/\1/"&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 09 Nov 2022 14:36:30 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2022-11-09T14:36:30Z</dc:date>
    <item>
      <title>What regex to use to drop everything after the last occurrence of a symbol?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-regex-to-use-to-drop-everything-after-the-last-occurrence/m-p/620287#M215624</link>
      <description>&lt;P&gt;Hi Splunk Community,&lt;/P&gt;
&lt;P&gt;I am working on a regex to filter the sources I am getting from logs. I am trying to drop everything after the last "/" in the field but I am having problems filtering.&lt;/P&gt;
&lt;P&gt;My current sources look something like:&amp;nbsp;&lt;SPAN&gt;/db2audit/fs01/db2inst1/extract/abc123/file.del&lt;/SPAN&gt;&lt;/P&gt;
&lt;P&gt;&lt;SPAN&gt;I am trying to filter it to look like:&amp;nbsp;/db2audit/fs01/db2inst1/extract/abc123&lt;BR /&gt;&lt;BR /&gt;Thanks in advance!&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 15:13:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-regex-to-use-to-drop-everything-after-the-last-occurrence/m-p/620287#M215624</guid>
      <dc:creator>jpfrancetic</dc:creator>
      <dc:date>2022-11-09T15:13:31Z</dc:date>
    </item>
    <item>
      <title>Re: Drop everything after last occurrence of Symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-regex-to-use-to-drop-everything-after-the-last-occurrence/m-p/620290#M215626</link>
      <description>&lt;P&gt;Try this command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex mode=sed field=foo "s/(.*)\/.*?$/\1/"&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 09 Nov 2022 14:36:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-regex-to-use-to-drop-everything-after-the-last-occurrence/m-p/620290#M215626</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2022-11-09T14:36:30Z</dc:date>
    </item>
    <item>
      <title>Re: Drop everything after last occurrence of Symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-regex-to-use-to-drop-everything-after-the-last-occurrence/m-p/620291#M215627</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243581"&gt;@jpfrancetic&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;if the first part is fixed in the first four folders, you could extract something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| rex field=source "^(?&amp;lt;path&amp;gt;(\/\w+){4}).*(?&amp;lt;filename&amp;gt;\/\w+\.\w+$)"&lt;/LI-CODE&gt;&lt;P&gt;that you can test at&amp;nbsp;&lt;A href="https://regex101.com/r/j7XgJ5/1" target="_blank"&gt;https://regex101.com/r/j7XgJ5/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Wed, 09 Nov 2022 14:39:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-regex-to-use-to-drop-everything-after-the-last-occurrence/m-p/620291#M215627</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-09T14:39:04Z</dc:date>
    </item>
    <item>
      <title>Re: Drop everything after last occurrence of Symbol</title>
      <link>https://community.splunk.com/t5/Splunk-Search/What-regex-to-use-to-drop-everything-after-the-last-occurrence/m-p/620371#M215653</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/243581"&gt;@jpfrancetic&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 10 Nov 2022 07:23:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/What-regex-to-use-to-drop-everything-after-the-last-occurrence/m-p/620371#M215653</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-10T07:23:11Z</dc:date>
    </item>
  </channel>
</rss>

