<?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 Using only 1 event out of many duplicate events in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Using-only-1-event-out-of-many-duplicate-events/m-p/691205#M114972</link>
    <description>&lt;P&gt;Greetings to you !!&lt;/P&gt;&lt;P&gt;I have a file in which I have a following content :&lt;/P&gt;&lt;P&gt;My city is very good&lt;/P&gt;&lt;P&gt;your city is also very good&lt;/P&gt;&lt;P&gt;but&lt;/P&gt;&lt;P&gt;but&lt;/P&gt;&lt;P&gt;but&lt;/P&gt;&lt;P&gt;but&lt;/P&gt;&lt;P&gt;Now, I want only three lines to be indexed in Splunk :&lt;/P&gt;&lt;P&gt;My city is very good&lt;/P&gt;&lt;P&gt;your city is also very good&lt;/P&gt;&lt;P&gt;but&lt;/P&gt;&lt;P&gt;Since "but" has appeared multiple times , so we want to use only 1 "but" out of many&lt;/P&gt;&lt;P&gt;I want to write props or any kind of configuration so that I can achieve this results.&lt;/P&gt;&lt;P&gt;Kindly help !!&lt;/P&gt;</description>
    <pubDate>Thu, 20 Jun 2024 19:40:20 GMT</pubDate>
    <dc:creator>abhaywdc</dc:creator>
    <dc:date>2024-06-20T19:40:20Z</dc:date>
    <item>
      <title>Using only 1 event out of many duplicate events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-only-1-event-out-of-many-duplicate-events/m-p/691205#M114972</link>
      <description>&lt;P&gt;Greetings to you !!&lt;/P&gt;&lt;P&gt;I have a file in which I have a following content :&lt;/P&gt;&lt;P&gt;My city is very good&lt;/P&gt;&lt;P&gt;your city is also very good&lt;/P&gt;&lt;P&gt;but&lt;/P&gt;&lt;P&gt;but&lt;/P&gt;&lt;P&gt;but&lt;/P&gt;&lt;P&gt;but&lt;/P&gt;&lt;P&gt;Now, I want only three lines to be indexed in Splunk :&lt;/P&gt;&lt;P&gt;My city is very good&lt;/P&gt;&lt;P&gt;your city is also very good&lt;/P&gt;&lt;P&gt;but&lt;/P&gt;&lt;P&gt;Since "but" has appeared multiple times , so we want to use only 1 "but" out of many&lt;/P&gt;&lt;P&gt;I want to write props or any kind of configuration so that I can achieve this results.&lt;/P&gt;&lt;P&gt;Kindly help !!&lt;/P&gt;</description>
      <pubDate>Thu, 20 Jun 2024 19:40:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-only-1-event-out-of-many-duplicate-events/m-p/691205#M114972</guid>
      <dc:creator>abhaywdc</dc:creator>
      <dc:date>2024-06-20T19:40:20Z</dc:date>
    </item>
    <item>
      <title>Re: Using only 1 event out of many duplicate events</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Using-only-1-event-out-of-many-duplicate-events/m-p/691501#M115015</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/266360"&gt;@abhaywdc&lt;/a&gt;&amp;nbsp;there are a few ways to do this. Here's a way to do this using props.conf/transforms.conf:&lt;BR /&gt;&lt;BR /&gt;props.conf:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;...
TRANSFORMS-removeDupe=removeDupe&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;transforms.conf:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[removeDupe]
REGEX = (?s)(.*?)((but[\r\n]+)+)(.*)
FORMAT = $1$3$4
DEST_KEY = _raw&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This transform tells Splunk to replace all the instances of "but" with the last instance, thereby de-duplicating them&lt;BR /&gt;&lt;BR /&gt;Explanation of the regex from regexr:&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="KendallW_0-1719292658039.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/31442iB9AE542D4258E6BB/image-size/medium?v=v2&amp;amp;px=400" role="button" title="KendallW_0-1719292658039.png" alt="KendallW_0-1719292658039.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 25 Jun 2024 05:20:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Using-only-1-event-out-of-many-duplicate-events/m-p/691501#M115015</guid>
      <dc:creator>KendallW</dc:creator>
      <dc:date>2024-06-25T05:20:35Z</dc:date>
    </item>
  </channel>
</rss>

