Getting Data In

Splunk is pulling the wrong custom .conf file

vanixishere
New Member

I have two apps that are both utilizing the same exact type of custom .conf file. The data in the .conf files are supposed to be different (it's information like specific IP addresses) that the user can change. Inside these apps I have a few scripts that retrieve data from the conf file.

My problem is that a script within X app is getting the conf data from the one in Y app, even though X app should have it's own copy of the conf file in it's own app/local directory. The conf files have the same header because the scripts are the same for each app (but are different because of the configurable IP information). Giving each conf file unique headers fixes the issue but requires users to edit the scripts which isn't a viable option.

Is there any way I can get my splunk script to ONLY search for the one conf file in it's app/local directory and not search further?
Also, the line I'm using in my script to retrieve data is from the splunk.clilib library...
config = cli_common.getConfStanza('filename', 'thisconfstanza')

0 Karma

codebuilder
Influencer

What you are encountering is the precedence of conf files.
There are a number of workarounds, but one potential is to put your conf in system/local, which has the highest precedence.
Or, deploy a app/TA with a name that takes precedence over your actual app(s).

----
An upvote would be appreciated and Accept Solution if it helps!
0 Karma
Get Updates on the Splunk Community!

Detecting Remote Code Executions With the Splunk Threat Research Team

REGISTER NOWRemote code execution (RCE) vulnerabilities pose a significant risk to organizations. If ...

Observability | Use Synthetic Monitoring for Website Metadata Verification

If you are on Splunk Observability Cloud, you may already have Synthetic Monitoringin your observability ...

More Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...