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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...