I've been trying to filter unwanted events on a heavy forwarder from being sent to indexers. I followed the instructions which I found in here http://docs.splunk.com/Documentation/Splunk/6.4.3/Forwarding/Routeandfilterdatad, more specifically, I followed this:
Keep specific events and discard the rest
This scenario is opposite to the previous scenario. In this example, you use two transforms to keep only the sshd events. One transform routes sshd events to indexQueue, while another routes all other events to nullQueue.
Note: In this example, the order of the transforms in props.conf matters. The null queue transform must come first; if it comes later, it will invalidate the previous transform and route all events to the null queue.
In props.conf:
[source::/var/log/messages]
TRANSFORMS-set= setnull,setparsing
2. In transforms.conf:
[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue
[setparsing]
REGEX = [sshd]
DEST_KEY = queue
FORMAT = indexQueue
1. Restart Splunk Enterprise.
But it doesn't work, can someone tell me where is the issue? This is my stanza:
props.conf
[source::/var/log/messages]
TRANSFORMS-null = setnull, setparsing
transforms.conf
[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue
[setparsing]
REGEX = splunk_agent.py
DEST_KEY = queue
FORMAT = indexQueue
... View more