Dashboards & Visualizations

Edit props.conf programatically

strive
Influencer

Hi,

We are using splunk 4.3.4. Is it possible to programmatically edit props.conf under deployment-apps directory.

Thanks

Strive

Tags (1)
0 Karma
1 Solution

sd23c109
Explorer

Hi Strive,

Since the .conf files are all text files, any "sed" type of program would work along with the staple scripting languages like PERL, Python, Ruby, etc. You can create a copy of the .conf file, make your changes based on what you put in the script, then push the changes to where ever you have your deployment server looking for new .conf files and bingo, done. Is this what you mean by "programmatically" edit?

Chris

View solution in original post

0 Karma

sowings
Splunk Employee
Splunk Employee

There is a RESTful API for Splunk, and you can use it to update configuration files. What I don't know is whether you can use the API to update configuration files in the deployment-apps hierarchy, as it would tend to write to the active apps instead.

More information about the REST API can be found here:

http://docs.splunk.com/Documentation/Splunk/latest/RESTAPI/RESTlist

0 Karma

sd23c109
Explorer

Hi Strive,

What is the MYSQL DB for? What "java" program are you referring to? I am not sure you need a REST API to update the conf file, but I would like to understand more about this REST API.

Thanks,

Chris Schaft
MKAdvantage

0 Karma

strive
Influencer

Hi jKat,

I do a field update on MYSQL database. At this time, I need to update the conf file present in deployment-apps from java program. Using some kind of REST API.

Thanks
Strive

0 Karma

sd23c109
Explorer

Hi Strive,

Since the .conf files are all text files, any "sed" type of program would work along with the staple scripting languages like PERL, Python, Ruby, etc. You can create a copy of the .conf file, make your changes based on what you put in the script, then push the changes to where ever you have your deployment server looking for new .conf files and bingo, done. Is this what you mean by "programmatically" edit?

Chris

0 Karma

Ayn
Legend

As far as I know you cannot access the apps in the deployment-apps directory through the REST API.

0 Karma

strive
Influencer

Hi Chris,

I do a field update on MYSQL database. At this time, I need to update the conf file present in deployment-apps from java program. Using some kind of REST API. Then fschange of splunk takes these changes from deployment-apps and deploy to apps of respective nodes.

Thanks
Strive

0 Karma

jkat54
SplunkTrust
SplunkTrust

Please explain what you mean by "programmatically edit".

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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...