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?
Labels (1)
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!

Announcing Scheduled Export GA for Dashboard Studio

We're excited to announce the general availability of Scheduled Export for Dashboard Studio. Starting in ...

Extending Observability Content to Splunk Cloud

Watch Now!   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to leverage ...

More Control Over Your Monitoring Costs with Archived Metrics GA in US-AWS!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...