Getting Data In

Values for Endpoints defined in the setup.xml file are not refreshed

santosh_sshanbh
Path Finder

I have created a 3 attributes (url1, user& snow_password) in the setup.xml for my custom alert action app.

 <input field="param.url1">
    <label>Enter your url</label>
    <type>text</type>
 </input>   
<input field="param.user">
  <label>enter user name</label>
  <type>text</type>
</input>
<input field="param.snow_credentials">
  <label>enter password</label>
  <type>password</type>
</input>

I am using these parameters in the Python script which calls a REST API method. I am retrieving the values for these parameters as below in Python script

    snow_url = settings['configuration'].get('url1')
    user = settings['configuration'].get('user')
    password = settings['configuration'].get('snow_credentials')

The issue I am facing is, when I set the parameter values for the 1st time using Setup screen the values are correctly retrieved by the script. But when I update them using the setup screen and run the script as a alert action it still retrieves the old values of the parameter and not new once.

I tried to check the values using URL
https://localhost:8089/servicesNS/nobody//alerts/alert_actions/

I can see the updated values. I also tried to reload them and try but still the script is getting old values only. Is there anything basic I am missing here?

0 Karma

santosh_sshanbh
Path Finder

Above mentioned XML data is located inside below tags.

0 Karma

lakshman239
Influencer

When you setup the parameters via setup page, I assume they are getting added under your app's local/ta_*settings.conf file. Does this get updated when you update the params via setup again? check your default/restmap.conf for handler actions - edit and list [ you need both]. Are you using add-on builder?

0 Karma

santosh_sshanbh
Path Finder

I am not using add-on builder. I started creating my app by using the reference of hipchat_alerts example.

When I update the parameters, they get updated in alert_actions.conf file in apps local directory. I have just added a validation rule in restmap.conf file, nothing about the setup parameters.

I do observed that, when I create a new alert it is getting updated values of setup parameters. So I think the json paylod passed to PYTHON script is sending old values only. I may have to use Splunk SDK to read endpoint values unless there is no alternative.

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!

From Data to Insight: Announcing the Winners of the Splunk Dashboard Contest

Hi Splunkers, First off, thank you to everyone who participated in our very first From Data to Insight: The ...

Splunk Developers: Construct Your Future at the .conf26 Builder Bar

Calling all Splunk architects, platform admins, and app developers: the site is open, and the blueprints are ...

Quick connection discovery mode for forwarders

When a Splunk forwarder loses connectivity to its indexers, it does not always reconnect immediately. In many ...