Getting Data In

Filter specific data to indexer

SplunkCSIT
Communicator

Hi,
i do not want to forward the body and the content field to indexer, how to go abt doing it? thks

<xml>
    <Field1>123</Field1>
    <Field2>456</Field2>
    <Body>Not to be forward to indexer</Body>
    <Field3>333</Field3>
    <content>not to be forward</content>
</xml>
Tags (1)
0 Karma

tararso
Explorer

props.conf and transforms.conf needs to configured on indexer, not at Universal forwarder. If you have heavy forwarder, you can use props.conf and transforms.conf.

0 Karma

SplunkCSIT
Communicator

someone had provided me the ans.it worked

0 Karma

MuS
SplunkTrust
SplunkTrust

Hi SplunkCSIT,

take a look at the docs about Filter event data and send to queues. If the wanted and unwanted fields are all in one event, you may need to use this example and instead of replacing the data you blank them out.

In your case you can either set the regex to something like this <Field\d+>(.+)<\/Field\d+> to match and keep only the Field events or set the regex to match (<Body>|<content>)(.+)<\/ and have that removed.

The regex's are untested because I don't have the real world event, so maybe they need some tuning.

Update: and like @linu1988 said, this must be done on a parsing Splunk instance like a Indexer and/or a heavy forarwder.

hope this helps ...

cheers, MuS

SplunkCSIT
Communicator

at props.conf,
[test]
TRANSFORMS-null = content

at transforms.conf,
[content]
REGEX = (.+)<\/content>
DEST_KEY = queue
FORMAT = nullQueue

I configured the props.conf and transforms.conf for both forwarder and indexer but it does not work. Any problem with my config files?

0 Karma

SplunkCSIT
Communicator

the props.conf and transforms.conf to be configured at forwarder or indexer?

0 Karma

linu1988
Champion

first of all you can't filter this not to be forwarded from forwarder. It need to be done on the indexer. Not sure as it is a single event how to apply sedcmd on this

0 Karma
Get Updates on the Splunk Community!

Unlock Database Monitoring with Splunk Observability Cloud

  In today’s fast-paced digital landscape, even minor database slowdowns can disrupt user experiences and ...

Purpose in Action: How Splunk Is Helping Power an Inclusive Future for All

At Cisco, purpose isn’t a tagline—it’s a commitment. Cisco’s FY25 Purpose Report outlines how the company is ...

[Upcoming Webinar] Demo Day: Transforming IT Operations with Splunk

Join us for a live Demo Day at the Cisco Store on January 21st 10:00am - 11:00am PST In the fast-paced world ...