All Apps and Add-ons

Splunk Addon builder - How do I Update a stanza value after config?

shahrukhvp
Explorer

As part of an TA that I am building, I have a requirement to change a few of the values in /apps/my_app/local/inputs.conf during the code run time .

Scenario: My code will retrieve an oauth2_access_token and oauth2_refresh_token every hour and this needs to be updated in the inputs.conf.
Any insight on how to achieve this?

As far as I have checked, no helper functions exist for the same. 

An alternative would be to keep another file somewhere inside the TA's directory to keep the latest values for these tokens. But is there a way we could get the actual app directory path from the script? using os.get_cwd is giving me the path : "/". Is this only during testing and it will change accordingly during the actual run ?

 

Labels (1)
0 Karma
Get Updates on the Splunk Community!

Upcoming Webinar: Unmasking Insider Threats with Slunk Enterprise Security’s UEBA

Join us on Wed, Dec 10. at 10AM PST / 1PM EST for a live webinar and demo with Splunk experts! Discover how ...

.conf25 technical session recap of Observability for Gen AI: Monitoring LLM ...

If you’re unfamiliar, .conf is Splunk’s premier event where the Splunk community, customers, partners, and ...

A Season of Skills: New Splunk Courses to Light Up Your Learning Journey

There’s something special about this time of year—maybe it’s the glow of the holidays, maybe it’s the ...