Dashboards & Visualizations

How to make a web service call from the dashboard?

mohitthapar
New Member

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?

Tags (1)
0 Karma

rvany
Communicator

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?

0 Karma

sboogaar
Path Finder

The documentation is incorrect. it is not even valid javascript.

0 Karma

renjith_nair
Legend

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

---
What goes around comes around. If it helps, hit it with Karma 🙂

niketn
Legend

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.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

niketn
Legend

@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.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

mohitthapar
New Member

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.

0 Karma
Get Updates on the Splunk Community!

Enterprise Security Content Update (ESCU) | New Releases

In January, the Splunk Threat Research Team had one release of new security content via the Splunk ES Content ...

Expert Tips from Splunk Professional Services, Ensuring Compliance, and More New ...

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...

Observability Release Update: AI Assistant, AppD + Observability Cloud Integrations & ...

This month’s releases across the Splunk Observability portfolio deliver earlier detection and faster ...