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!

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...