Getting Data In

remove specific folder from input

Nawab
Communicator

I have configured syslog-ng to listen on multiple ports, save them in a folder with IP name and hf to send logs to indexers, 

In one case i have 127.0.0.1 sending as loopback to syslog-ng server, now i want to remove this IP from my input configs.

let suppose I have below folder

/opt/syslog/Fortigate

under fortigate I have mutiple fortigates sending logs and i dont know in future we can add a new fortigate here 1 hot is 127.0.0.1, i want to remove this from my inputs, what should I do.

Labels (1)
0 Karma
1 Solution

livehybrid
Super Champion

Hi @Nawab 

Modify the inputs.conf file on your Splunk forwarder to add a blacklist entry for the specific directory you want to exclude.

Locate the stanza for your directory input, e.g. [monitor:///opt/syslog/Fortigate], and add the blacklist line.

[monitor:///opt/syslog/Fortigate]
disabled = false
# ... other settings like index, sourcetype ...
blacklist = /opt/syslog/Fortigate/127\.0\.0\.1/.*

This configuration tells Splunk to monitor the /opt/syslog/Fortigate directory but ignore any files or subdirectories within the /opt/syslog/Fortigate/127.0.0.1 path. The \. escapes the dots in the IP address, and /.* ensures that everything within that specific directory is excluded.

After saving the changes to inputs.conf, you must restart the Splunk forwarder for the changes to take effect.

Check out the following inputs.conf docs on blacklist of files: https://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf#:~:text=way.%0A*%20No%20default...

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

View solution in original post

0 Karma

Nawab
Communicator

I just pasted blacklist 127.0.0.1, and when I ran list monitor all 127.0.0.1 is remove, is it correct or should i used your method

0 Karma

livehybrid
Super Champion

Hi @Nawab 

That should work too, its using a regex to match so 127.0.0.1 I guess will also match 🙂

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

0 Karma

livehybrid
Super Champion

Hi @Nawab 

Modify the inputs.conf file on your Splunk forwarder to add a blacklist entry for the specific directory you want to exclude.

Locate the stanza for your directory input, e.g. [monitor:///opt/syslog/Fortigate], and add the blacklist line.

[monitor:///opt/syslog/Fortigate]
disabled = false
# ... other settings like index, sourcetype ...
blacklist = /opt/syslog/Fortigate/127\.0\.0\.1/.*

This configuration tells Splunk to monitor the /opt/syslog/Fortigate directory but ignore any files or subdirectories within the /opt/syslog/Fortigate/127.0.0.1 path. The \. escapes the dots in the IP address, and /.* ensures that everything within that specific directory is excluded.

After saving the changes to inputs.conf, you must restart the Splunk forwarder for the changes to take effect.

Check out the following inputs.conf docs on blacklist of files: https://docs.splunk.com/Documentation/Splunk/latest/Admin/Inputsconf#:~:text=way.%0A*%20No%20default...

🌟 Did this answer help you? If so, please consider:

  • Adding karma to show it was useful
  • Marking it as the solution if it resolved your issue
  • Commenting if you need any clarification

Your feedback encourages the volunteers in this community to continue contributing

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud's AI Assistant in Action Series: Auditing Compliance and ...

This is the third post in the Splunk Observability Cloud’s AI Assistant in Action series that digs into how to ...

Splunk Community Badges!

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

What You Read The Most: Splunk Lantern’s Most Popular Articles!

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...