Splunk Search

While using splunk Rest api getting 404 error in authentication

test_accenture
Loves-to-Learn

to do Splunk search with the help of API I am getting 404 error while doing this call

response = self.session.get(self.base_url + '/servicesNS/'+self.username+'/search/auth/login', data=payload)
 
can someone please tell me why this is happening?
Tags (2)
0 Karma

PickleRick
SplunkTrust
SplunkTrust

Firstly, I'm not sure if you can call the auth/login in such namespace.

The API reference says only about

https://<host>:<mPort>/services/auth/login

But more importantly, the auth/login endpoint only supports POST requests. You don't GET from it.

0 Karma

test_accenture
Loves-to-Learn

if I am trying this query with a post request I am getting unauthorized 401 error

0 Karma

PickleRick
SplunkTrust
SplunkTrust
0 Karma

test_accenture
Loves-to-Learn

do you mean my creds?

0 Karma

PickleRick
SplunkTrust
SplunkTrust

Yes. As shown in the examples in docs.

Oh, and does your user have the role/capability to use API?

0 Karma

KumaarJai
Observer

Are you able to get a response when you hit this as a plain curl request?

0 Karma
Get Updates on the Splunk Community!

Splunk Observability Cloud’s AI Assistant in Action Series: Analyzing and ...

This is the second post in our Splunk Observability Cloud’s AI Assistant in Action series, in which we look at ...

Elevate Your Organization with Splunk’s Next Platform Evolution

 Thursday, July 10, 2025  |  11AM PDT / 2PM EDT Whether you're managing complex deployments or looking to ...

Splunk Answers Content Calendar, June Edition

Get ready for this week’s post dedicated to Splunk Dashboards! We're celebrating the power of community by ...