<?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: Filter partial duplicates in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-partial-duplicates/m-p/631573#M219360</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Thanks for the fast answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It definitly helped but I&amp;nbsp;realised it's a bit more complicated that what i described.&lt;BR /&gt;&lt;BR /&gt;Your suggestion gives as output :&lt;BR /&gt;&lt;BR /&gt;first&lt;BR /&gt;second&lt;BR /&gt;third&lt;BR /&gt;&lt;BR /&gt;Where i'd like to have te full path until there&lt;BR /&gt;x/y/first&lt;/P&gt;&lt;P&gt;x/y/second&lt;/P&gt;&lt;P&gt;x/y/third&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Because there might be for exemple :&lt;BR /&gt;x/y/first&lt;/P&gt;&lt;P&gt;x/z/second/random.pdf&lt;/P&gt;&lt;P&gt;x/z/second/random.pdf&lt;/P&gt;&lt;P&gt;x/y/third&lt;BR /&gt;&lt;BR /&gt;Not an expert in regex and even less in splunk regex synthax. Sorry if it sound like something so simple i should have found myself.&lt;/P&gt;</description>
    <pubDate>Mon, 20 Feb 2023 12:51:44 GMT</pubDate>
    <dc:creator>Yukie</dc:creator>
    <dc:date>2023-02-20T12:51:44Z</dc:date>
    <item>
      <title>How can I filter partial duplicates?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-partial-duplicates/m-p/631559#M219358</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;
&lt;P&gt;I'm new to splunk (Internship) and couldn't find and answer.&lt;/P&gt;
&lt;P&gt;I'd need a way to filter my search.&lt;/P&gt;
&lt;P&gt;I'm curently using a ".... | ... | stats count by RequestPath" search.&lt;/P&gt;
&lt;P&gt;The problem is that the "RequestPath" can contain variable/random data at the end.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Exemple:&lt;BR /&gt;x/y/first&lt;/P&gt;
&lt;P&gt;x/y/second/randomText&lt;/P&gt;
&lt;P&gt;x/y/second/randomText&lt;/P&gt;
&lt;P&gt;x/y/third&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;There are millions outputs and i would like to filter them so i only keep :&lt;/P&gt;
&lt;P&gt;x/y/first&lt;/P&gt;
&lt;P&gt;x/y/second&lt;/P&gt;
&lt;P&gt;x/y/third&lt;BR /&gt;&lt;BR /&gt;Thanks &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 15:24:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-partial-duplicates/m-p/631559#M219358</guid>
      <dc:creator>Yukie</dc:creator>
      <dc:date>2023-02-21T15:24:42Z</dc:date>
    </item>
    <item>
      <title>Re: Filter partial duplicates</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-partial-duplicates/m-p/631562#M219359</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254065"&gt;@Yukie&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you have to extract a part of the RequestPath using the rex command and use it for the stats command, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| rex field=RequestPath "\w+\/\w+\/(?&amp;lt;SubPath&amp;gt;[^\/\n]+)"
| stats count BY SubPath&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 11:28:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-partial-duplicates/m-p/631562#M219359</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-02-20T11:28:43Z</dc:date>
    </item>
    <item>
      <title>Re: Filter partial duplicates</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-partial-duplicates/m-p/631573#M219360</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;,&lt;BR /&gt;Thanks for the fast answer.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It definitly helped but I&amp;nbsp;realised it's a bit more complicated that what i described.&lt;BR /&gt;&lt;BR /&gt;Your suggestion gives as output :&lt;BR /&gt;&lt;BR /&gt;first&lt;BR /&gt;second&lt;BR /&gt;third&lt;BR /&gt;&lt;BR /&gt;Where i'd like to have te full path until there&lt;BR /&gt;x/y/first&lt;/P&gt;&lt;P&gt;x/y/second&lt;/P&gt;&lt;P&gt;x/y/third&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;Because there might be for exemple :&lt;BR /&gt;x/y/first&lt;/P&gt;&lt;P&gt;x/z/second/random.pdf&lt;/P&gt;&lt;P&gt;x/z/second/random.pdf&lt;/P&gt;&lt;P&gt;x/y/third&lt;BR /&gt;&lt;BR /&gt;Not an expert in regex and even less in splunk regex synthax. Sorry if it sound like something so simple i should have found myself.&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 12:51:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-partial-duplicates/m-p/631573#M219360</guid>
      <dc:creator>Yukie</dc:creator>
      <dc:date>2023-02-20T12:51:44Z</dc:date>
    </item>
    <item>
      <title>Re: Filter partial duplicates</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-partial-duplicates/m-p/631575#M219362</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/254065"&gt;@Yukie&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;no problem, please try this regex&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;^(?&amp;lt;SubPath&amp;gt;[^\/]+\/[^\/]+\/[^\/\n]+)&lt;/LI-CODE&gt;&lt;P&gt;that you an test at&amp;nbsp;&lt;A href="https://regex101.com/r/0hzRax/1" target="_blank"&gt;https://regex101.com/r/0hzRax/1&lt;/A&gt;&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 20 Feb 2023 13:01:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-can-I-filter-partial-duplicates/m-p/631575#M219362</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2023-02-20T13:01:39Z</dc:date>
    </item>
  </channel>
</rss>

