<?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 Re: Use Splunk JavaScript SDK to return SID from Splunk in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/How-to-use-Splunk-JavaScript-SDK-to-return-SID-from-Splunk/m-p/407506#M7031</link>
    <description>&lt;P&gt;I ended up using node js to solve this issue.  The javascript sdk just wasn't working (maybe due to corporate security issues)&lt;/P&gt;</description>
    <pubDate>Tue, 04 Jun 2019 18:17:23 GMT</pubDate>
    <dc:creator>ssharm02</dc:creator>
    <dc:date>2019-06-04T18:17:23Z</dc:date>
    <item>
      <title>How to use Splunk JavaScript SDK to return SID from Splunk search?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-use-Splunk-JavaScript-SDK-to-return-SID-from-Splunk/m-p/407505#M7030</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;I am trying to use the Splunk JavaScript SDK in order to return a SID from a search. I used the code that's provided in the documentation or mentioned in the forum.&lt;BR /&gt;```&lt;/P&gt;
&lt;PRE&gt;&lt;CODE&gt;      let http = new splunkjs.JQueryHttp();
      let service = new splunkjs.Service(http,{
      username: "@#$@#$",
      password: "@#$@#",
      scheme: "https",
      host: "digitalsplunk.test.com/services/search/jobs",
      port: "8089",
      version: "7.1.0"
    });

    // First, we log in
    service.login(function (err, success) {
      // We check for both errors in the connection as well
      // as if the login itself failed.
      if (err || !success) {
        console.log('error is ' + err)
        console.log(
          "Login failure. Please check your server hostname and authentication credentials."
        );
        //done(err || "Login failed");
        console.log('logon failure')
        return;
      } else  if (success) {
        console.log('logon successful')
      }```
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;P&gt;This code messes up the URL. This is what the url looks like using the search object&lt;BR /&gt;&lt;A href="https://digitalsplunk.test.com/services/search/jobs:8089/services/auth/login?output_mode=json" target="_blank"&gt;https://digitalsplunk.test.com/services/search/jobs:8089/services/auth/login?output_mode=json&lt;/A&gt;&lt;BR /&gt;And this is what it should look like &lt;BR /&gt;&lt;A href="https://digitalsplunk.test.com:8089/services/search/jobs?output_mode=json" target="_blank"&gt;https://digitalsplunk.test.com:8089/services/search/jobs?output_mode=json&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;I also tried making an angular service (without the Splunk SDK) and made a post request, it didn't work either. If anyone could help me fetch the SID, I would greatly appreciate it&lt;/P&gt;</description>
      <pubDate>Wed, 17 Jun 2020 23:05:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-use-Splunk-JavaScript-SDK-to-return-SID-from-Splunk/m-p/407505#M7030</guid>
      <dc:creator>ssharm02</dc:creator>
      <dc:date>2020-06-17T23:05:28Z</dc:date>
    </item>
    <item>
      <title>Re: Use Splunk JavaScript SDK to return SID from Splunk</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/How-to-use-Splunk-JavaScript-SDK-to-return-SID-from-Splunk/m-p/407506#M7031</link>
      <description>&lt;P&gt;I ended up using node js to solve this issue.  The javascript sdk just wasn't working (maybe due to corporate security issues)&lt;/P&gt;</description>
      <pubDate>Tue, 04 Jun 2019 18:17:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/How-to-use-Splunk-JavaScript-SDK-to-return-SID-from-Splunk/m-p/407506#M7031</guid>
      <dc:creator>ssharm02</dc:creator>
      <dc:date>2019-06-04T18:17:23Z</dc:date>
    </item>
  </channel>
</rss>

