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 App for Anomaly Detection End of Life Announcement

Q: What is happening to the Splunk App for Anomaly Detection?A: Splunk is officially announcing the ...

Aligning Observability Costs with Business Value: Practical Strategies

 Join us for an engaging Tech Talk on Aligning Observability Costs with Business Value: Practical ...

Mastering Data Pipelines: Unlocking Value with Splunk

 In today's AI-driven world, organizations must balance the challenges of managing the explosion of data with ...