Getting Data In

Difference between Splunk rest api services and servicesNS?

Vinesh93
Explorer

What is the difference between services and servicesNS in splunk rest api. Can someone explain it in detail?
Thanks in advance.

richgalloway
SplunkTrust
SplunkTrust

servicesNS limits its scope to the specified namespace (username and app). It can apply to all namespaces by specifying - as the user and app names.

---
If this reply helps you, Karma would be appreciated.

jkat54
SplunkTrust
SplunkTrust

I agree with Rich, please see https://docs.splunk.com/Documentation/Splunk/8.0.2/RESTUM/RESTusing for more details. There is a "NAMESPACE" section.

bayuste
Engager

I disagree. Reading Rich’s answer would lead you to believe that “| rest /servicesNS” is more restrictive than “| rest /services” by limiting the scope to the specified namespace. In fact, it is the other way around.

Or, more precisely, “| rest /services” is equivalent to “| rest /servicesNS/<currentUser>/<defaultApp>”, which implicitly limits the results to what is visible from the current user running in the default app context, which is usually the search app.

We can expand the namespace to include more results by converting the call to “| rest /servicesNS/-/-“, or we can change the namespace to an explicit user/app context with “| rest /servicesNS/<arbitraryUser>/<arbitraryApp>”.

It is a subtle but important difference. For some global system-wide resources, the results will be the same from every user/app context. In those cases, the call is usually shortened from “| rest /servicesNS/-/-” to “| rest /services”.

So, every time I see “| rest /services”, I translate that in my head to be “| rest /servicesNS/<currentUser>/<defaultApp>”

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