<?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 anonymize data using REGEX in transforms.conf for an undefined number of characters? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218913#M64347</link>
    <description>&lt;P&gt;also what if you put single quotes around the regex?&lt;/P&gt;</description>
    <pubDate>Fri, 26 Feb 2016 18:48:10 GMT</pubDate>
    <dc:creator>jkat54</dc:creator>
    <dc:date>2016-02-26T18:48:10Z</dc:date>
    <item>
      <title>How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218902#M64336</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I would like to anonymize data (data is file system path) using REGEX. I succesfully managed to hide data like IP, Credit Card Number, etc. But not able to replicate the setup for an undefined number of characters.&lt;/P&gt;

&lt;P&gt;Could you please help reviewing the below code:&lt;/P&gt;

&lt;P&gt;props.conf:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[amit_anonymize_data]
TRANSFORMS-anonymize = filepath-anonymizer
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[filepath-anonymizer]
REGEX = (?m)^(.*)filePath=\S+(.*)$
FORMAT = $1filePath=XXXX$2
DEST_KEY = _raw
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Below an example of logs that must be transformed:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2016-02-25 14:40 GMT+1 this is only an example filePath="/tmp/file.log" error script 1
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The log is indexed without any modification.&lt;/P&gt;

&lt;P&gt;Thanks for your help.&lt;/P&gt;

&lt;P&gt;Cyril&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 14:33:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218902#M64336</guid>
      <dc:creator>SirHill17</dc:creator>
      <dc:date>2016-02-25T14:33:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218903#M64337</link>
      <description>&lt;P&gt;What happens when you do this?  Anything, or is the _raw unchanged?&lt;/P&gt;

&lt;P&gt;And have you tried without multiline?  (The &lt;CODE&gt;(?m)&lt;/CODE&gt; at the front)?  That may also be making it behave slightly differently.&lt;/P&gt;</description>
      <pubDate>Thu, 25 Feb 2016 16:46:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218903#M64337</guid>
      <dc:creator>Richfez</dc:creator>
      <dc:date>2016-02-25T16:46:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218904#M64338</link>
      <description>&lt;P&gt;Is the sourcetype on the input set correctly (amit_anonymize_data)?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 08:56:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218904#M64338</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-09-29T08:56:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218905#M64339</link>
      <description>&lt;P&gt;Yes _raw is unchanged. Just tried without (?m) but no success.&lt;/P&gt;

&lt;P&gt;Is the FORMAT mentioned correct? My concern is about the number of char that XXXX replace. If the filePath has 15 characters, it will be replace by XXXX (4X) ? Is that right?&lt;/P&gt;

&lt;P&gt;Thanks.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 07:58:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218905#M64339</guid>
      <dc:creator>SirHill17</dc:creator>
      <dc:date>2016-02-26T07:58:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218906#M64340</link>
      <description>&lt;P&gt;Yes the sourcetype is correct.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 07:58:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218906#M64340</guid>
      <dc:creator>SirHill17</dc:creator>
      <dc:date>2016-02-26T07:58:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218907#M64341</link>
      <description>&lt;P&gt;Hi, please try this regex with positive lookahead and positive lookbehind.&lt;/P&gt;

&lt;P&gt;Props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[amit_anonymize_data]
TRANSFORMS-anonymize = filepath-anonymizer
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Transforms.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[filepath-anonymizer]
REGEX = '(.*)(?&amp;lt;=filePath=").*(?=")(.*)'
FORMAT = $1XXXX$2
DEST_KEY = _raw
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 26 Feb 2016 13:10:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218907#M64341</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-02-26T13:10:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218908#M64342</link>
      <description>&lt;P&gt;The FORMAT string looks correct to me.  Yes, the filepath will be replaced by 4 X's no matter how many characters are in the original path.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 13:10:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218908#M64342</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2016-02-26T13:10:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218909#M64343</link>
      <description>&lt;P&gt;No more success. From your input I also tried&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;(?&amp;lt;=filePath=")\S+(?=")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;but no more success.&lt;/P&gt;

&lt;P&gt;Can anything else impact it?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 14:10:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218909#M64343</guid>
      <dc:creator>SirHill17</dc:creator>
      <dc:date>2016-02-26T14:10:38Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218910#M64344</link>
      <description>&lt;P&gt;My apologies.  I have corrected my answer.&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 14:28:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218910#M64344</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-02-26T14:28:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218911#M64345</link>
      <description>&lt;P&gt;Unfortunately no change. I don't really know what's wrong...&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 15:58:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218911#M64345</guid>
      <dc:creator>SirHill17</dc:creator>
      <dc:date>2016-02-26T15:58:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218912#M64346</link>
      <description>&lt;P&gt;Ok so what is the architecture here?  Are there forwarders etc?  You say you can mask CCredit cards but did you do that in development on single Splunk instance and now you're trying this other redaction in production where the architecture is different?  &lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 18:24:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218912#M64346</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-02-26T18:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218913#M64347</link>
      <description>&lt;P&gt;also what if you put single quotes around the regex?&lt;/P&gt;</description>
      <pubDate>Fri, 26 Feb 2016 18:48:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218913#M64347</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-02-26T18:48:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218914#M64348</link>
      <description>&lt;P&gt;I am working on a DEV environment (same one as Credit Card masking). Files props.conf and transforms.conf have been updated on the indexer server. Data is coming from a forwarder yes. &lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 08:03:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218914#M64348</guid>
      <dc:creator>SirHill17</dc:creator>
      <dc:date>2016-02-29T08:03:45Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218915#M64349</link>
      <description>&lt;P&gt;Great, it's working with the single quotes. Thanks!!!&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 12:47:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218915#M64349</guid>
      <dc:creator>SirHill17</dc:creator>
      <dc:date>2016-02-29T12:47:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218916#M64350</link>
      <description>&lt;P&gt;Awesome!  I edited the answer to add the single quotes for folks looking in the future.&lt;/P&gt;

&lt;P&gt;Thanks for the follow up and marking the answer!&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 13:28:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218916#M64350</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-02-29T13:28:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218917#M64351</link>
      <description>&lt;P&gt;this makes me think your first regex might have worked with single quotes too.  Its hard to tell which regex is less resource intensive without testing but I assume my regex requires more effort by the CPU due to the lookaheads.&lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 13:29:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218917#M64351</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-02-29T13:29:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218918#M64352</link>
      <description>&lt;P&gt;In case it could help:&lt;/P&gt;

&lt;P&gt;I have customized the REGEX to take in account the case where the path would contain a space char (which can happened but should not &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; )&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;'^(.*)(?&amp;lt;=filePath=").*?(?=")(.*)$'
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 29 Feb 2016 14:10:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218918#M64352</guid>
      <dc:creator>SirHill17</dc:creator>
      <dc:date>2016-02-29T14:10:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to anonymize data using REGEX in transforms.conf for an undefined number of characters?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218919#M64353</link>
      <description>&lt;P&gt;Very nice, great follow up!  I didnt even think about spacing in file paths... &lt;/P&gt;</description>
      <pubDate>Mon, 29 Feb 2016 14:25:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-anonymize-data-using-REGEX-in-transforms-conf-for-an/m-p/218919#M64353</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-02-29T14:25:06Z</dc:date>
    </item>
  </channel>
</rss>

