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!

A Guide To Cloud Migration Success

As enterprises’ rapid expansion to the cloud continues, IT leaders are continuously looking for ways to focus ...

Join Us for Splunk University and Get Your Bootcamp Game On!

If you know, you know! Splunk University is the vibe this summer so register today for bootcamps galore ...

.conf24 | Learning Tracks for Security, Observability, Platform, and Developers!

.conf24 is taking place at The Venetian in Las Vegas from June 11 - 14. Continue reading to learn about the ...