Getting Data In

Transforming special characters in XML

jedatt01
Builder

I have an XML based source that has special characters defined. See below

&   &   
<   &lt;    
>   &gt;    
"   &quot;  
'   &apos;  

Does anyone know how to use transforms.conf to convert these to the real characters in the left column at index time?

Tags (2)
0 Karma

somesoni2
Revered Legend

Add this in your sourcetype definition (props.conf)

[yoursourcetype]
...
..other configs..
...
SEDCMD-specialchars1 = s/specialcodeInxml/replacementcode/g

You need to add one entry for each special character replacement.
e.g.

  for &
        SEDCMD-specialchars5 = s/&amp;/\&/g
  for others
        SEDCMD-specialchars3 = s/&quot;/"/g
        SEDCMD-specialchars4 = s/&apos;/'/g

For more details see this documentation-
http://docs.splunk.com/Documentation/Splunk/6.1.1/Data/Anonymizedatausingconfigurationfiles

search for "Anonymize data through a sed script"

Get Updates on the Splunk Community!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...