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!

Data Management Digest – December 2025

Welcome to the December edition of Data Management Digest! As we continue our journey of data innovation, the ...

Index This | What is broken 80% of the time by February?

December 2025 Edition   Hayyy Splunk Education Enthusiasts and the Eternally Curious!    We’re back with this ...

Unlock Faster Time-to-Value on Edge and Ingest Processor with New SPL2 Pipeline ...

Hello Splunk Community,   We're thrilled to share an exciting update that will help you manage your data more ...