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
Get Updates on the Splunk Community!

Index This | Why did the turkey cross the road?

November 2025 Edition  Hayyy Splunk Education Enthusiasts and the Eternally Curious!   We’re back with this ...

Enter the Agentic Era with Splunk AI Assistant for SPL 1.4

  🚀 Your data just got a serious AI upgrade — are you ready? Say hello to the Agentic Era with the ...

Feel the Splunk Love: Real Stories from Real Customers

Hello Splunk Community,    What’s the best part of hearing how our customers use Splunk? Easy: the positive ...