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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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
SplunkTrust
SplunkTrust

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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Meet the .conf26 AI Agent Buildathon Winners

At the .conf26 AI Agent Buildathon, Splunk users turned their operational expertise into working AI agents ...

Trusted Autonomy in the SOC: A Maturity Journey

AI is compressing attacker timelines and pushing SOC teams beyond human capacity thresholds. The next SOC ...

Supercharging Windows Security Detection Performance: Introducing Hybrid Field ...

Windows event logs—from Security auditing and Sysmon to PowerShell script blocks—form the operational backbone ...