Security

Node / Javascript SDK for Splunk Not Allowing Login

8ksangani
Engager

I'm creating a node script to connect to splunk and retrieve data using a one shot search. However, I've found that the javascript SDK isn't successfully allowing me to connect to my splunk account. I'm trying to connect to splunk.medu.com with the port 8000, with an account linked to a larger company, and yet I'm receiving login errors when doing so. I've read through all of the javascript SDK pages trying to resolve this problem and have tried many iterations of port, server, username, and password options for the login, and nothing so far has worked. This is the code I've been using:

var splunkjs = require('splunk-sdk');

var service = new splunkjs.Service({

    username: "[username removed]",
    password:"[password removed]",
    scheme:"http",
    host:"splunk.medu.com",
    port:"8000",
    version:"5.0"
});

service.oneshotSearch("search ERROR", {}, function(err, results) {

    if(err) console.log("ERROR!: " + err);
    else console.log("RESULTS: " + results);
    console.log(err);
});

The login errors I receive lead me to an HTML page with a 404 error: The path \'/en-US/services/auth/login\' was not found. It says that the server is running, and that I am connected to the Splunk system (You are using splunk.medu.com:8000, which is connected to splunkd @143156 at https://127.0.0.1:8089 on Thu Jun 20 17:05:12 2013.), but that it can't login because of this missing page.

Any help would be greatly appreciated. Thanks!

Tags (1)

gkanapathy
Splunk Employee
Splunk Employee

pretty sure the issue was answered below.

0 Karma

rickshaw12
Explorer

I am having the same exact problem.. Was this issue ever resolved?

0 Karma

gkanapathy
Splunk Employee
Splunk Employee

You're using the wrong port/URL. http port 8000 is the web UI. The API is on https port 8089, as suggested by your error message.

Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas

Why Splunk Customers Should Attend Cisco Live 2026 Las Vegas     Cisco Live 2026 is almost here, and this ...

What Is the Name of the USB Key Inserted by Bob Smith? (BOTS Hint, Not the Answer)

Hello Splunkers,   So you searched, “what is the name of the usb key inserted by bob smith?”  Not gonna lie… ...

Automating Threat Operations and Threat Hunting with Recorded Future

    Automating Threat Operations and Threat Hunting with Recorded Future June 29, 2026 | Register   Is your ...