<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Why am I getting the following 'call not properly authenticated' error when using Splunk SDK for JavaScript? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-the-following-call-not-properly-authenticated/m-p/402629#M116506</link>
    <description>&lt;P&gt;Whenever I try to do a search query using Splunk SDK for JavaScript (using node), I get the following error message: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ messages: [ { type: 'WARN', text: 'call not properly authenticated' } ] }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I checked multiple forums but none have helped. &lt;/P&gt;

&lt;P&gt;I am able to login (always), but as soon as I call search() function, I get this error. &lt;/P&gt;

&lt;P&gt;Here is my function call: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    splunkService.login (err, success) -&amp;gt;
        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) -&amp;gt;
        splunkService.search query, params, (err, job) -&amp;gt;
            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) -&amp;gt;
                        console.log 'Done, here!'

                        job.results {}, (err, results, job) -&amp;gt;
                            if err
                                console.log err

                            else
                                results.fields.forEach (field) -&amp;gt;
                                    console.log field

                                results.rows.forEach (row) -&amp;gt;
                                    console.log row

                    failed: (job) -&amp;gt;
                        console.log 'Job failed'

                    error: (err) -&amp;gt;
                        console.log err.data
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please note, oneshotSearch() always works, search() works but just 2 times out of 10. &lt;/P&gt;</description>
    <pubDate>Fri, 28 Sep 2018 13:35:54 GMT</pubDate>
    <dc:creator>rumman92</dc:creator>
    <dc:date>2018-09-28T13:35:54Z</dc:date>
    <item>
      <title>Why am I getting the following 'call not properly authenticated' error when using Splunk SDK for JavaScript?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-the-following-call-not-properly-authenticated/m-p/402629#M116506</link>
      <description>&lt;P&gt;Whenever I try to do a search query using Splunk SDK for JavaScript (using node), I get the following error message: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;{ messages: [ { type: 'WARN', text: 'call not properly authenticated' } ] }
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I checked multiple forums but none have helped. &lt;/P&gt;

&lt;P&gt;I am able to login (always), but as soon as I call search() function, I get this error. &lt;/P&gt;

&lt;P&gt;Here is my function call: &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    splunkService.login (err, success) -&amp;gt;
        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) -&amp;gt;
        splunkService.search query, params, (err, job) -&amp;gt;
            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) -&amp;gt;
                        console.log 'Done, here!'

                        job.results {}, (err, results, job) -&amp;gt;
                            if err
                                console.log err

                            else
                                results.fields.forEach (field) -&amp;gt;
                                    console.log field

                                results.rows.forEach (row) -&amp;gt;
                                    console.log row

                    failed: (job) -&amp;gt;
                        console.log 'Job failed'

                    error: (err) -&amp;gt;
                        console.log err.data
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Please note, oneshotSearch() always works, search() works but just 2 times out of 10. &lt;/P&gt;</description>
      <pubDate>Fri, 28 Sep 2018 13:35:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-am-I-getting-the-following-call-not-properly-authenticated/m-p/402629#M116506</guid>
      <dc:creator>rumman92</dc:creator>
      <dc:date>2018-09-28T13:35:54Z</dc:date>
    </item>
  </channel>
</rss>

