Getting Data In

case statement logic in inputs.conf

a212830
Champion

Hi,

Is there a way to setup inputs.conf so that a default sourcetype (and it's associated props) will be used, unless a later, more precise association is found?

For example:

[default)
anything....

[specific_match1)
stuff

[specific_match2]
stuff

We use rsyslog to route syslog messages to logfiles. The logfiles are written to ../YYYY/MM/DD/system-hostname.log and we then use inputs.conf to determine the sourcetype. The match is typically done on the name of the host - so, hostA* are netscreens, and hostB* are some other device type... In prod, this works fine. However, when a new device type comes on-board, we test it first, and I become the bottleneck, because inputs.conf needs to be updated. My hope is to setup something as described above and put it in test, so that the engineers can route any device syslog, without requiring my intervention.

Is this possible?

Tags (2)
0 Karma

dmaislin_splunk
Splunk Employee
Splunk Employee
0 Karma

a212830
Champion

I can, but before I go down that path, I guess my question is how does the forwarder handle matches? Does it take the first? The last? Does it do nothing? If I know it behaves in a certain manner, then I can test out that situation.

0 Karma

dmaislin_splunk
Splunk Employee
Splunk Employee

Can you be a bit more specific. Give me some real examples with full source path/host.log so I can see how you are doing this today. Then show me a new host that is added that doesn't fit that criteria. I am happy to help.

0 Karma

a212830
Champion

I've read that doc. I don't see any setup that addresses my situation. Can you be more specific?

0 Karma
Get Updates on the Splunk Community!

Faster Insights with AI, Streamlined Cloud-Native Operations, and More New Lantern ...

Splunk Lantern is a Splunk customer success center that provides practical guidance from Splunk experts on key ...

Splunk Enterprise Security: Your Command Center for PCI DSS Compliance

Every security professional knows the drill. The PCI DSS audit is approaching, and suddenly everyone's asking ...

Developer Spotlight with Guilhem Marchand

From Splunk Engineer to Founder: The Journey Behind TrackMe    After spending over 12 years working full time ...