I want to call a web service from the dashboard using post method from the UI. How to define the web service in the app?
Are you familiar with Splunk SDK or SplunkJS? Is this link http://docs.splunk.com/DocumentationStatic/JavaScriptSDK/1.8.3/splunkjs.Service.Endpoint.html of any help?
The documentation is incorrect. it is not even valid javascript.
Hi @mohitthapar,
Probably you have to get the data first in splunk and build dashboard on top of that as mentioned in https://www.splunk.com/blog/2013/06/18/getting-data-from-your-rest-apis-into-splunk.html
Agreed, besides REST API Modular input, you can also try the Splunk Add On Builder. You can configure the input to get data through POST (Refer to the documentation http://docs.splunk.com/Documentation/AddonBuilder/latest/UserGuide/ConfigureDataCollection).
Alternatively, you can create your own python script to POST to REST API URL and process the response and ingest to Splunk. http://docs.splunk.com/Documentation/Splunk/latest/AdvancedDev/ModAlertsBasicExample
On click on a button in UI, you can invoke your Python Script using the script command.
@mohitthapar, could you elaborate on your use case as to what is the trigger condition for POST action and any other details on what you want to send with POST to which REST Endpoint (or is it custom)?
You can create POST Workflow Action on the Raw events based on their eventtype:
https://docs.splunk.com/Documentation/Splunk/latest/Knowledge/SetupaPOSTworkflowaction
Not sure if this is what you need.
Thanks. I want to show the output(Example: Risk Score or something) of rest API call in UI on a button click. On button click that rest API should be called and display the response. So how to define this rest API inside our app.