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
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...