<?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 Mask partial value in Splunk _raw Data using SED in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Mask-partial-value-in-Splunk-raw-Data-using-SED/m-p/384436#M95202</link>
    <description>&lt;P&gt;Hi, I have the below event in my splunk logs and i want to partially mask few things - &lt;BR /&gt;
1. I want to just remove the IP's which is at the end of 2nd line - 12.12.12.12&lt;BR /&gt;
2. I want to partially mask the digits in between from this - number: 441234567809. Like 44******809.&lt;BR /&gt;
And i want to do this in _raw events because i will be exporting the _raw file from Splunk after masking&lt;/P&gt;

&lt;P&gt;--5f72c-A--&lt;BR /&gt;
[21/May/2019:23:55:01 +0100] dffsdfsdfds129.654.234.92 5666 12.12.12.12&lt;BR /&gt;
--5472c-B--&lt;BR /&gt;
GET /testHTTP/1.1&lt;BR /&gt;
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,&lt;EM&gt;/&lt;/EM&gt;;q=0.8&lt;BR /&gt;
Accept-Encoding: gzip&lt;BR /&gt;
User-Agent: okhttp/3.10.0&lt;BR /&gt;
number: 441234567809&lt;/P&gt;

&lt;P&gt;Can someone please guide how to do this using sed command?&lt;/P&gt;</description>
    <pubDate>Wed, 22 May 2019 09:40:45 GMT</pubDate>
    <dc:creator>Shashank_87</dc:creator>
    <dc:date>2019-05-22T09:40:45Z</dc:date>
    <item>
      <title>Mask partial value in Splunk _raw Data using SED</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mask-partial-value-in-Splunk-raw-Data-using-SED/m-p/384436#M95202</link>
      <description>&lt;P&gt;Hi, I have the below event in my splunk logs and i want to partially mask few things - &lt;BR /&gt;
1. I want to just remove the IP's which is at the end of 2nd line - 12.12.12.12&lt;BR /&gt;
2. I want to partially mask the digits in between from this - number: 441234567809. Like 44******809.&lt;BR /&gt;
And i want to do this in _raw events because i will be exporting the _raw file from Splunk after masking&lt;/P&gt;

&lt;P&gt;--5f72c-A--&lt;BR /&gt;
[21/May/2019:23:55:01 +0100] dffsdfsdfds129.654.234.92 5666 12.12.12.12&lt;BR /&gt;
--5472c-B--&lt;BR /&gt;
GET /testHTTP/1.1&lt;BR /&gt;
Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,image/apng,&lt;EM&gt;/&lt;/EM&gt;;q=0.8&lt;BR /&gt;
Accept-Encoding: gzip&lt;BR /&gt;
User-Agent: okhttp/3.10.0&lt;BR /&gt;
number: 441234567809&lt;/P&gt;

&lt;P&gt;Can someone please guide how to do this using sed command?&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 09:40:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mask-partial-value-in-Splunk-raw-Data-using-SED/m-p/384436#M95202</guid>
      <dc:creator>Shashank_87</dc:creator>
      <dc:date>2019-05-22T09:40:45Z</dc:date>
    </item>
    <item>
      <title>Re: Mask partial value in Splunk _raw Data using SED</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mask-partial-value-in-Splunk-raw-Data-using-SED/m-p/384437#M95203</link>
      <description>&lt;P&gt;Just to add on to the above :&lt;BR /&gt;
I am using this but it is masking both the IP's but i only want to mask the 2nd IP which is at the end of that line -&lt;BR /&gt;
| rex field=_raw mode=sed "s/(\d+.\d+.+\d+.\d+)/****/g"&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 11:00:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mask-partial-value-in-Splunk-raw-Data-using-SED/m-p/384437#M95203</guid>
      <dc:creator>Shashank_87</dc:creator>
      <dc:date>2019-05-22T11:00:14Z</dc:date>
    </item>
    <item>
      <title>Re: Mask partial value in Splunk _raw Data using SED</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mask-partial-value-in-Splunk-raw-Data-using-SED/m-p/384438#M95204</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;If you want to mask data at search time you can use below regex.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;yoursearch&amp;gt;
| rex field=_raw mode=sed "s/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}(\v)/\1/"
| rex field=_raw mode=sed "s/(number\:\s\d{2})\d+(\d{3})/\1***\2/"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 22 May 2019 13:55:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mask-partial-value-in-Splunk-raw-Data-using-SED/m-p/384438#M95204</guid>
      <dc:creator>harsmarvania57</dc:creator>
      <dc:date>2019-05-22T13:55:40Z</dc:date>
    </item>
    <item>
      <title>Re: Mask partial value in Splunk _raw Data using SED</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Mask-partial-value-in-Splunk-raw-Data-using-SED/m-p/384439#M95205</link>
      <description>&lt;P&gt;All this is part of single event? Do you want to mask the data at index time OR search time?&lt;/P&gt;</description>
      <pubDate>Wed, 22 May 2019 14:58:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Mask-partial-value-in-Splunk-raw-Data-using-SED/m-p/384439#M95205</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-05-22T14:58:59Z</dc:date>
    </item>
  </channel>
</rss>

