<?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 in transform.conf delete text in the middle in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344089#M101932</link>
    <description>&lt;P&gt;Are you restarting Splunk after each change to the config files?&lt;/P&gt;</description>
    <pubDate>Mon, 24 Apr 2017 19:13:42 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2017-04-24T19:13:42Z</dc:date>
    <item>
      <title>Regex in transform.conf delete text in the middle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344086#M101929</link>
      <description>&lt;P&gt;I'm having some trouble to delete the text in "plugin_set". &lt;/P&gt;

&lt;P&gt;Sample Incoming data:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; {"plugin_family": "somestuff", "policy": "somsestuff2", "plugin_set": "10026;10111;10150;10170;10183;", "pokemon": "somsestuff3"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Sample what I want:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; {"plugin_family": "somestuff", "policy": "somsestuff2", "plugin_set": "", "pokemon": "somsestuff3"}
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This the closest that I got:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = (.*)("plugin_set".*\,)
DEST_KEY = _raw
FORMAT = $1 nullQueue
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I also tried this, but that showed everything.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = (.*)("plugin_set".*\,)(.*)
DEST_KEY = _raw
FORMAT = $1 nullQueue $3
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What is the right regex string for deleting the text in "plugin_set"?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 09:18:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344086#M101929</guid>
      <dc:creator>Alwiinie</dc:creator>
      <dc:date>2017-04-24T09:18:23Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in transform.conf delete text in the middle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344087#M101930</link>
      <description>&lt;P&gt;Try this.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = (.*"plugin_set":\s")([^,]+)(",.*)
DEST_KEY = _raw
FORMAT = $1$3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Apr 2017 13:02:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344087#M101930</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-04-24T13:02:27Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in transform.conf delete text in the middle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344088#M101931</link>
      <description>&lt;P&gt;It doesn't work, it just shows the all the data.&lt;/P&gt;

&lt;P&gt;Btw in the props.conf I use this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;TRANSFORMS-set = removepluginset
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Apr 2017 14:34:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344088#M101931</guid>
      <dc:creator>Alwiinie</dc:creator>
      <dc:date>2017-04-24T14:34:25Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in transform.conf delete text in the middle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344089#M101932</link>
      <description>&lt;P&gt;Are you restarting Splunk after each change to the config files?&lt;/P&gt;</description>
      <pubDate>Mon, 24 Apr 2017 19:13:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344089#M101932</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2017-04-24T19:13:42Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in transform.conf delete text in the middle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344090#M101933</link>
      <description>&lt;P&gt;Try this in transforms.conf at indexer/heavy forwarder (assuming you're taking care of props.conf changes already)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;REGEX = ^(.+\"plugin_set\"\:\s*\")([^\"]+)(\".+)
DEST_KEY = _raw
FORMAT = $1$3
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 24 Apr 2017 20:41:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344090#M101933</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-04-24T20:41:25Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in transform.conf delete text in the middle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344091#M101934</link>
      <description>&lt;P&gt;Yes, after every change in transform.conf I restart Splunk.&lt;/P&gt;</description>
      <pubDate>Tue, 25 Apr 2017 06:54:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344091#M101934</guid>
      <dc:creator>Alwiinie</dc:creator>
      <dc:date>2017-04-25T06:54:19Z</dc:date>
    </item>
    <item>
      <title>Re: Regex in transform.conf delete text in the middle</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344092#M101935</link>
      <description>&lt;P&gt;It doesn't work this also showed everything. I don't know if need to change the props.conf more then I now have.&lt;BR /&gt;
This what I currently have:&lt;BR /&gt;
tansform.conf:&lt;BR /&gt;
    [removepluginset]&lt;BR /&gt;
    REGEX = ^(.+\"plugin_set\":\s*\")([^\"]+)(\".+)&lt;BR /&gt;
    DEST_KEY = _raw&lt;BR /&gt;
    FORMAT = $1$3&lt;/P&gt;

&lt;P&gt;props.conf&lt;BR /&gt;
    [host::hostname]&lt;BR /&gt;
    TRANSFORMS-set = removepluginset&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:49:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Regex-in-transform-conf-delete-text-in-the-middle/m-p/344092#M101935</guid>
      <dc:creator>Alwiinie</dc:creator>
      <dc:date>2020-09-29T13:49:30Z</dc:date>
    </item>
  </channel>
</rss>

