Splunk Search

Why am I getting the following 'call not properly authenticated' error when using Splunk SDK for JavaScript?

rumman92
New Member

Whenever I try to do a search query using Splunk SDK for JavaScript (using node), I get the following error message:

{ messages: [ { type: 'WARN', text: 'call not properly authenticated' } ] }

I checked multiple forums but none have helped.

I am able to login (always), but as soon as I call search() function, I get this error.

Here is my function call:

    splunkService.login (err, success) ->
        if err
            console.log err.data
        else
            console.log ("Login is successful")  #this always successful

            query = 'search index=a sourcetype=b application=*abc* | top 1 error'
            params = {
                earliest_time: '-15m'
                latest_time: 'now'
                exec_mode: 'normal'
            }

            searchSplunk(query, params)

    searchSplunk = (query, params) ->
        splunkService.search query, params, (err, job) ->
            if err
                console.log 'Error Encountered:'
                console.log err.data
            else
                console.log 'Job ID: ' + job.sid
                #console.log job

                job.track {period: 200},
                    done: (job) ->
                        console.log 'Done, here!'

                        job.results {}, (err, results, job) ->
                            if err
                                console.log err

                            else
                                results.fields.forEach (field) ->
                                    console.log field

                                results.rows.forEach (row) ->
                                    console.log row

                    failed: (job) ->
                        console.log 'Job failed'

                    error: (err) ->
                        console.log err.data

Please note, oneshotSearch() always works, search() works but just 2 times out of 10.

0 Karma
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!

May 2026 Splunk Expert Sessions: Security & Observability

Level Up Your Operations: May 2026 Splunk Expert Sessions Whether you are refining your security posture or ...

Network to App: Observability Unlocked [May & June Series]

In today’s digital landscape, your environment is no longer confined to the data center. It spans complex ...

SPL2 Deep Dives, AppDynamics Integrations, SAML Made Simple and Much More on Splunk ...

Splunk Lantern is Splunk’s customer success center that provides practical guidance from Splunk experts on key ...