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

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

April 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...