<?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 Anonymize only Child Nodes in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Anonymize-only-Child-Nodes/m-p/264706#M50818</link>
    <description>&lt;P&gt;Hello,&lt;BR /&gt;
I was wondering could anyone help me figure out the sed script required and regex to Anonymize child nodes from xml - The difficulty seems to be due to the fact each node takes it's own line within splunk rather than usual single line &lt;CODE&gt;&amp;lt;testfield&amp;gt; 123 &amp;lt;/testfield&amp;gt;&lt;/CODE&gt;. Here is an example of how it appears:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;userDetails&amp;gt; 
&amp;lt;name&amp;gt; 
&amp;lt;testfield&amp;gt; 
123
&amp;lt;/testfield&amp;gt; 
&amp;lt;/name&amp;gt;
&amp;lt;/userDetails&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the appearance I would want would be something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;userDetails&amp;gt; 
 &amp;lt;name&amp;gt; 
 &amp;lt;testfield&amp;gt; 
 xxxx
 &amp;lt;/testfield&amp;gt;
 &amp;lt;/name&amp;gt;
 &amp;lt;/userDetails&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help would be great with this - thank you.&lt;/P&gt;

&lt;P&gt;James &lt;/P&gt;</description>
    <pubDate>Wed, 30 Mar 2016 10:05:07 GMT</pubDate>
    <dc:creator>jmaguire1992</dc:creator>
    <dc:date>2016-03-30T10:05:07Z</dc:date>
    <item>
      <title>Anonymize only Child Nodes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Anonymize-only-Child-Nodes/m-p/264706#M50818</link>
      <description>&lt;P&gt;Hello,&lt;BR /&gt;
I was wondering could anyone help me figure out the sed script required and regex to Anonymize child nodes from xml - The difficulty seems to be due to the fact each node takes it's own line within splunk rather than usual single line &lt;CODE&gt;&amp;lt;testfield&amp;gt; 123 &amp;lt;/testfield&amp;gt;&lt;/CODE&gt;. Here is an example of how it appears:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;userDetails&amp;gt; 
&amp;lt;name&amp;gt; 
&amp;lt;testfield&amp;gt; 
123
&amp;lt;/testfield&amp;gt; 
&amp;lt;/name&amp;gt;
&amp;lt;/userDetails&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;And the appearance I would want would be something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;userDetails&amp;gt; 
 &amp;lt;name&amp;gt; 
 &amp;lt;testfield&amp;gt; 
 xxxx
 &amp;lt;/testfield&amp;gt;
 &amp;lt;/name&amp;gt;
 &amp;lt;/userDetails&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Any help would be great with this - thank you.&lt;/P&gt;

&lt;P&gt;James &lt;/P&gt;</description>
      <pubDate>Wed, 30 Mar 2016 10:05:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Anonymize-only-Child-Nodes/m-p/264706#M50818</guid>
      <dc:creator>jmaguire1992</dc:creator>
      <dc:date>2016-03-30T10:05:07Z</dc:date>
    </item>
    <item>
      <title>Re: Anonymize only Child Nodes</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Anonymize-only-Child-Nodes/m-p/264707#M50819</link>
      <description>&lt;P&gt;I figured it out - Here is the answer for anyone who might need it.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt; SEDCMD-testdata_anonymizer = s/(.*)&amp;lt;testfield&amp;gt;[\s\S]*?&amp;lt;\/testfield&amp;gt;.*/\1 &amp;lt;testfield&amp;gt;xxxx&amp;lt;\/testfield&amp;gt;/g
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 30 Mar 2016 10:39:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Anonymize-only-Child-Nodes/m-p/264707#M50819</guid>
      <dc:creator>jmaguire1992</dc:creator>
      <dc:date>2016-03-30T10:39:22Z</dc:date>
    </item>
  </channel>
</rss>

