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

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!

Using Machine Learning for Hunting Security Threats

WATCH NOW Seeing the exponential hike in global cyber threat spectrum, organizations are now striving more for ...

New Learning Videos on Topics Most Requested by You! Plus This Month’s New Splunk ...

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

How I Instrumented a Rust Application Without Knowing Rust

As a technical writer, I often have to edit or create code snippets for Splunk's distributions of ...