Getting Data In

How to Access Splunk's REST API

_gkollias
Builder

I'm working on sending requests to Splunk's REST API for the first time and have a few questions after reading through the tutorial/manual:

  1. I can't locate the /services/ directory under /splunk/home/. Is this created out of the box, or something we need to add in /etc/apps?

  2. Our dev environment is currently http - will sending requests to http://localhost:8080/... be sufficient for testing?

Any insight is greatly appreciated.

Thanks!

0 Karma

Damien_Dallimor
Ultra Champion

There are numerous examples (using CURL) of using the Splunk REST API in the reference manual.

Via your browser you could also browse to https://localhost:8089/services

Furthermore , we have many language SDK's that make it easier to programmatically interact with the Splunk REST API.

0 Karma

_gkollias
Builder

Thanks, Damien

Again the example you've posted goes back to using https with port 8089. Our dev environment is currently http - would that make a difference? Here is what I see when I use http://localhost:8080

The path '/en-US/services' was not found.

What should I see here?

0 Karma

Damien_Dallimor
Ultra Champion

8089 is splunk's default management port and the port you access the Rest Api at over https.

Perhaps you are confusing yourself with the Splunk Web port which is by default 8000 and accessed over http.This is not Splunk's Rest Api endpoint.

Please follow and try the advice in my prior post.

0 Karma

richgalloway
SplunkTrust
SplunkTrust
  1. You don't need to create anything for the REST API to work.
  2. That should work just fine.
---
If this reply helps you, Karma would be appreciated.

_gkollias
Builder

Awesome - maybe I'm over-thinking this one. So it's really as simple as if there is no /services/ directory just point it to wherever the saved search is IE http://localhost:8080/en-US/apps/search/saved/searches?

0 Karma

richgalloway
SplunkTrust
SplunkTrust

You're still over-thinking it. 🙂 There is no services directory, but you must still include it in your query. Follow the manual and you should do fine.

---
If this reply helps you, Karma would be appreciated.
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!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Modernize your Splunk Apps – Introducing Python 3.13 in Splunk

We are excited to announce that the upcoming releases of Splunk Enterprise 10.2.x and Splunk Cloud Platform ...

Step into “Hunt the Insider: An Splunk ES Premier Mystery” to catch a cybercriminal ...

After a whole week of being on call, you fell asleep on your keyboard, and you hit a sequence of buttons that ...