Getting Data In

filtering on host

a212830
Champion

I've setup a heavy forwarder so that some feeds are going to one set of indexers, and another feed is going to a different set of indexers. I also setup a filter, so that only certain events are indexed (the rest are discarded). Now, I want to filter specifically on hosts that match a regex. How do I do that? It appears that the regex in transforms.conf works on the entire event, not just the host. Is there a way to do this?

0 Karma

jeff
Contributor

When you say you want to "filter", you are implying you want to take action (change indexer, drop data) based on the regex of the host? You would do this by specifying the host-matching pattern for the host in props.conf, which is regex-based (with the exception of ..., ., and *).

props.conf

[host::(my.+[1-6])|(otherhost[0-9]{0,})]
TRANSFORMS-drop = drop_event

transforms.conf

[drop_event]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

a212830
Champion

Essentially, I want a whitelist. OK. I think that I get it. I'll give it a whirl...

0 Karma
Get Updates on the Splunk Community!

Introducing Splunk Enterprise 9.2

WATCH HERE! Watch this Tech Talk to learn about the latest features and enhancements shipped in the new Splunk ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...

Routing logs with Splunk OTel Collector for Kubernetes

The Splunk Distribution of the OpenTelemetry (OTel) Collector is a product that provides a way to ingest ...