Getting Data In

Receiving an HTTP 303 (See Other) response from Splunk Server using the API

johndeer430
Engager

I'm trying to communicate with Splunk via the API and I'm getting HTTP 303 errors when I attempt to get the session key. Usernames and passwords have been purposely filled with "user" and "pass". Example is based off of the Splunk documentation.

curl -u user:pass -k https://ourserver.host.com:8070/services/auth/login -d"username=user&password=pass"

I get this back (cURL reports an HTTP status of 303 - See Other):
This resource can be found at <a href='https://ourserver.host.com:8000/en-US/services/auth/login'>https://ourserver.host.com:8070/en-US/services/auth/login</a>.

So I try this:
curl -u user:pass -k https://ourserver.host.com:8070/en-US/services/auth/login -d"username=user&password=pass"

...and I get a 404.

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<!-- 
   This is a static HTML string template to render errors.  To edit this
   template, see appserver/mrsparkle/lib/error.py. 
-->

<html xmlns="http://www.w3.org/1999/xhtml" xmlns:splunk="http://www.splunk.com/xhtml-extensions/1.0" xml:lang="en">
<head>
   <meta http-equiv="content-type" content="text/html; charset=utf-8" />
   <title>The path '/en-US/services/auth/login' was not found. - Splunk</title>
   <style>
[...]
Tags (1)
1 Solution

nchaturvedi
Explorer

This solved my issue. Connecting to management port rather that the WEBUI port.

View solution in original post

0 Karma

sideview
SplunkTrust
SplunkTrust

It looks like you're hitting the SplunkWeb port, not the management port (aka Splunkd port).

If you dont know what your management port is, login as the admin user, and go to Manager > System Settings > General Settings.

the default value is 8089, but since your SplunkWeb port is 8070 instead of 8000, im guessing the other one was changed too.

nchaturvedi
Explorer

This solved my issue. Connecting to management port rather that the WEBUI port.

0 Karma
Get Updates on the Splunk Community!

Stay Connected: Your Guide to May Tech Talks, Office Hours, and Webinars!

Take a look below to explore our upcoming Community Office Hours, Tech Talks, and Webinars this month. This ...

They're back! Join the SplunkTrust and MVP at .conf24

With our highly anticipated annual conference, .conf, comes the fez-wearers you can trust! The SplunkTrust, as ...

Enterprise Security Content Update (ESCU) | New Releases

Last month, the Splunk Threat Research Team had two releases of new security content via the Enterprise ...