Splunk Enterprise

How to get the API url for splunk dashboards

mdarveka
New Member

I am attempting to retrieve search results from a Splunk dashboard via REST API but I am unable to identify the correct API endpoint. I have the URL to the Splunk Web UI (port 8000), which does not expose direct API calls , so where can I find the API url.

Labels (1)
0 Karma

ayush1906
Communicator

Rest API is by default exposed at port 8089

 

curl -k -u admin:pass https://localhost:8089/services/messages \
	-d name=sampleMessage \
	-d value="This is a sample message."

 
For all supported methods and functions can refer - 
https://help.splunk.com/en/splunk-enterprise/rest-api-reference/10.0/introduction/endpoints-referenc... 

Additionally can check out dev.splunk.com as well

0 Karma

isoutamo
SplunkTrust
SplunkTrust
As other already said, I'm not sure what you are looking for.
Maybe this helps you https://help.splunk.com/en/splunk-enterprise/leverage-rest-apis/rest-api-reference/9.4/introduction/... and look here .../scheduled/views and other under it?
0 Karma

PickleRick
SplunkTrust
SplunkTrust

What do you mean by "API for dashboards"? What is the problem you're trying to solve?

As @ITWhisperer said - there are enpdoints which return the dashboard definitions, there are endpoints which run the searches. But the dashboard as such is rendered to a "viewable" state by Splunk server and returned as a dynamic HTML page so you cannot - as I suspect you're trying to do - a rendered HTML version of a dashboard by a REST API call.

You can use a tool like Selenium to simulate user session in a browser but I'm not 100% sure it's what you're after.

ITWhisperer
SplunkTrust
SplunkTrust

I am not sure you will find such a thing. There are APIs to retrieve dashboard views and there are APIs to retrieve scheduled searches, etc. But, I am guessing this is not what you are after? What are you trying to do? Perhaps there may be another way to approach it?

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!

[Puzzles] Solve, Learn, Repeat: Character substitutions with Regular Expressions

This challenge was first posted on Slack #puzzles channelFor BORE at .conf23, we had a puzzle question which ...

Splunk Community Badges!

  Hey everyone! Ready to earn some serious bragging rights in the community? Along with our existing badges ...

[Puzzles] Solve, Learn, Repeat: Matching cron expressions

This puzzle (first published here) is based on matching timestamps to cron expressions.All the timestamps ...