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!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...