Getting Data In

processing only certain hosts from a file

a212830
Champion

Hi,

I have a logfile with a bunch of hosts, but I only want to index certain hosts and throw the rest away. How would I do this?

Tags (1)
0 Karma
1 Solution

Ayn
Legend

Create a regex that matches the hosts you want to index data from and send the rest of the events to the nullQueue. http://docs.splunk.com/Documentation/Splunk/5.0.1/Deploy/Routeandfilterdatad#Keep_specific_events_an...

View solution in original post

0 Karma

Ayn
Legend

Create a regex that matches the hosts you want to index data from and send the rest of the events to the nullQueue. http://docs.splunk.com/Documentation/Splunk/5.0.1/Deploy/Routeandfilterdatad#Keep_specific_events_an...

0 Karma

a212830
Champion

Never mind - brain fart! All set.

0 Karma

okrabbe_splunk
Splunk Employee
Splunk Employee

Is the [source] stanza actually inputs.conf or did you put it in props.conf?

0 Karma

a212830
Champion

I tried following the doc, and I keep getting a possible typo error. I can't find the problem.

inputs.conf:

[monitor:///usr/local/nsmutils/varlog/ncosyslog.log]
disabled = false
followTail = 0
index= throwaway
sourcetype = euc_syslogdata

[source::/usr/local/nsmutils/varlog/ncosyslog.log]
TRANSFORMS-set=setnull,setparsing

transforms.conf:
[setnull]
REGEX = .
DEST_KEY = queue
FORMAT = nullQueue

[setparsing]
REGEX = [vc-]
DEST_KEY = queue
FORMAT = indexQueue

0 Karma

a212830
Champion

Exactly what I'm looking for! Thanks.

0 Karma
Get Updates on the Splunk Community!

Splunk + ThousandEyes: Correlate frontend, app, and network data to troubleshoot ...

 Are you tired of troubleshooting delays caused by siloed frontend, application, and network data? We've got a ...

Splunk Observability for AI

Don’t miss out on an exciting Tech Talk on Splunk Observability for AI!Discover how Splunk’s agentic AI ...

🔐 Trust at Every Hop: How mTLS in Splunk Enterprise 10.0 Makes Security Simpler

From Idea to Implementation: Why Splunk Built mTLS into Splunk Enterprise 10.0  mTLS wasn’t just a checkbox ...