Security

How to cherry pick fields from raw xml records before indexing

riotto
Path Finder

I have several raw xml events that are getting indexed from a monitored log. The log is forwarded from a universal forwarder. The xml event is pretty long and I only want to index certain fields from it. How can I do this before indexing so that I can save my daily volume limit which is starting to exceed the limit.

Tags (2)
0 Karma

woodcock
Esteemed Legend

Best practice is to do this with "something else" to keep the Indexers from being overloaded with work that "other things" can do, to keep them free to do the stuff that "only Indexers can do". You might do this with a heavy forwarder, but I would not. I would write my own pre-parser code to strip out the stuff that I need and write it to a different file in a special directory for only these files and then have your Splunk UF monitor that other directory of pre-processed files.

0 Karma

niketn
Legend

@riotto, you can define props.conf to index only selected part of XML. Try something like the following:

BREAK_ONLY_BEFORE=\<yourRequiredXMLNode\>
MUST_BREAK_AFTER=\<\/yourRequiredXMLNode\>

If the part of XML you want to index also has timestamp field you would need to define TIME_PREFIX and TIME_FORMAT as well.

If it does not work you might have to provide us with sample XML data after mocking/anonymizing any sensitive data and also what props.conf you have for your sourcetype.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma
Get Updates on the Splunk Community!

Built-in Service Level Objectives Management to Bridge the Gap Between Service & ...

Wednesday, May 29, 2024  |  11AM PST / 2PM ESTRegister now and join us to learn more about how you can ...

Get Your Exclusive Splunk Certified Cybersecurity Defense Engineer Certification at ...

We’re excited to announce a new Splunk certification exam being released at .conf24! If you’re headed to Vegas ...

Share Your Ideas & Meet the Lantern team at .Conf! Plus All of This Month’s New ...

Splunk Lantern is Splunk’s customer success center that provides advice from Splunk experts on valuable data ...