<?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: How to remove everything BEFORE the second comma AND before indexing? in Splunk Enterprise</title>
    <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-remove-everything-BEFORE-the-second-comma-AND-before/m-p/642419#M16257</link>
    <description>&lt;P&gt;The existing transform moves any event that matches the regex to nullQueue.&amp;nbsp; Try these settings to re-write the event.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[remove_before_comma]
REGEX = ^([^,]*,[^,]*),(.*)
DEST_KEY = _raw
FORMAT = $2&lt;/LI-CODE&gt;</description>
    <pubDate>Fri, 05 May 2023 16:42:13 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2023-05-05T16:42:13Z</dc:date>
    <item>
      <title>How to remove everything BEFORE the second comma AND before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-remove-everything-BEFORE-the-second-comma-AND-before/m-p/642417#M16256</link>
      <description>&lt;P&gt;I have the following events&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;lt;190&amp;gt;May 4 20:20:36 data.test.com 1,2023/05/04 20:20:35,013001101002958,test,end,2305,2023/05/04&lt;/P&gt;
&lt;P&gt;I want to remove everything before the second comma (including the&amp;nbsp; comma)&lt;/P&gt;
&lt;P&gt;Since i dont want it to be indexed , im using the props and transforms on my HF to do that . My regex seems to work but when i try to implement it ,it does not filter anything&amp;nbsp;&lt;/P&gt;
&lt;P&gt;props.conf&lt;/P&gt;
&lt;P&gt;[source::/var/log/splunk/IP/syslog.log]&lt;BR /&gt;TRANSFORMS-null = remove_before_comma&lt;/P&gt;
&lt;P&gt;transforms.conf&lt;/P&gt;
&lt;P&gt;[remove_before_comma]&lt;BR /&gt;REGEX = ^([^,]*,[^,]*),&lt;BR /&gt;DEST_KEY = queue&lt;BR /&gt;FORMAT = nullQueue&lt;/P&gt;
&lt;P&gt;Here is the regex&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://regex101.com/r/Lxqgue/1" target="_blank" rel="noopener"&gt;https://regex101.com/r/Lxqgue/1&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Any idea why this is not working properly&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 16:08:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-remove-everything-BEFORE-the-second-comma-AND-before/m-p/642417#M16256</guid>
      <dc:creator>newsplunker1</dc:creator>
      <dc:date>2023-05-05T16:08:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove everything BEFORE the second comma AND before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-remove-everything-BEFORE-the-second-comma-AND-before/m-p/642419#M16257</link>
      <description>&lt;P&gt;The existing transform moves any event that matches the regex to nullQueue.&amp;nbsp; Try these settings to re-write the event.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;[remove_before_comma]
REGEX = ^([^,]*,[^,]*),(.*)
DEST_KEY = _raw
FORMAT = $2&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 05 May 2023 16:42:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-remove-everything-BEFORE-the-second-comma-AND-before/m-p/642419#M16257</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-05-05T16:42:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove everything BEFORE the second comma AND before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-remove-everything-BEFORE-the-second-comma-AND-before/m-p/642425#M16258</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;That seems to do the trick ( I ll mark yours as the asnwer ) - Do you have any idea on how to use SED to replace the strings before the comma with a number lets say 0 for example&amp;nbsp;&lt;/P&gt;&lt;P&gt;this is the original event&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;lt;190&amp;gt;May 4 20:20:36 data.test.com 1,2023/05/04 20:20:35,013001101002958&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;becomes like&lt;/P&gt;&lt;P&gt;0,0,013001101002958&lt;/P&gt;</description>
      <pubDate>Fri, 05 May 2023 17:39:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-remove-everything-BEFORE-the-second-comma-AND-before/m-p/642425#M16258</guid>
      <dc:creator>newsplunker1</dc:creator>
      <dc:date>2023-05-05T17:39:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to remove everything BEFORE the second comma AND before indexing?</title>
      <link>https://community.splunk.com/t5/Splunk-Enterprise/How-to-remove-everything-BEFORE-the-second-comma-AND-before/m-p/642427#M16259</link>
      <description>&lt;P&gt;SED is search-time rather than index-time, but you could do it with this props:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;SEDCMD-replaceUpToComma = s/^([^,]*,[^,]*),/0/&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 05 May 2023 17:39:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Enterprise/How-to-remove-everything-BEFORE-the-second-comma-AND-before/m-p/642427#M16259</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-05-05T17:39:18Z</dc:date>
    </item>
  </channel>
</rss>

