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!

Brains, Bytes, and Boston: Learn from the Best at .conf25

When you think of Boston, you might picture colonial charm, world-class universities, or even the crack of a ...

Splunk AppDynamics Agents Webinar Series

Mark your calendars! On June 24th at 12PM PST, we’re going live with the second session of our Splunk ...

SplunkTrust Application Period is Officially OPEN!

It's that time, folks! The application/nomination period for the 2025 SplunkTrust is officially open! If you ...