<?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 How to get session key for Splunk connect in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-session-key-for-Splunk-connect/m-p/355041#M23152</link>
    <description>&lt;P&gt;While Connect the Splunk Using Service.connect am getting 401 error due authentication getting failed. I have to pass session key or token on login post method header. Am striking with getting  session key/token. Can you resolve this by with out using Curl&lt;/P&gt;

&lt;P&gt;Code: &lt;/P&gt;

&lt;P&gt;Service service = new Service("XX.XXX.X.XXX", YYYY,"http");&lt;BR /&gt;
service.login("XXXXXX", "YYYYY);&lt;/P&gt;

&lt;P&gt;Error: &lt;/P&gt;

&lt;P&gt;Exception in thread "main" com.splunk.HttpException: HTTP 401 -- {"status":1}&lt;BR /&gt;
    at com.splunk.HttpException.create(HttpException.java:84)&lt;BR /&gt;
    at com.splunk.HttpService.send(HttpService.java:500)&lt;BR /&gt;
    at com.splunk.Service.send(Service.java:1297)&lt;BR /&gt;
    at com.splunk.HttpService.post(HttpService.java:348)&lt;BR /&gt;
    at com.splunk.Service.login(Service.java:1125)&lt;BR /&gt;
    at com.Practice.SplunkConnection.secureConnection(SplunkConnection.java:132)&lt;BR /&gt;
    at com.Practice.SplunkConnection.main(SplunkConnection.java:79)&lt;BR /&gt;
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 18:30:16 GMT</pubDate>
    <dc:creator>npbala_22</dc:creator>
    <dc:date>2020-09-29T18:30:16Z</dc:date>
    <item>
      <title>How to get session key for Splunk connect</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-session-key-for-Splunk-connect/m-p/355041#M23152</link>
      <description>&lt;P&gt;While Connect the Splunk Using Service.connect am getting 401 error due authentication getting failed. I have to pass session key or token on login post method header. Am striking with getting  session key/token. Can you resolve this by with out using Curl&lt;/P&gt;

&lt;P&gt;Code: &lt;/P&gt;

&lt;P&gt;Service service = new Service("XX.XXX.X.XXX", YYYY,"http");&lt;BR /&gt;
service.login("XXXXXX", "YYYYY);&lt;/P&gt;

&lt;P&gt;Error: &lt;/P&gt;

&lt;P&gt;Exception in thread "main" com.splunk.HttpException: HTTP 401 -- {"status":1}&lt;BR /&gt;
    at com.splunk.HttpException.create(HttpException.java:84)&lt;BR /&gt;
    at com.splunk.HttpService.send(HttpService.java:500)&lt;BR /&gt;
    at com.splunk.Service.send(Service.java:1297)&lt;BR /&gt;
    at com.splunk.HttpService.post(HttpService.java:348)&lt;BR /&gt;
    at com.splunk.Service.login(Service.java:1125)&lt;BR /&gt;
    at com.Practice.SplunkConnection.secureConnection(SplunkConnection.java:132)&lt;BR /&gt;
    at com.Practice.SplunkConnection.main(SplunkConnection.java:79)&lt;BR /&gt;
Picked up JAVA_TOOL_OPTIONS: -agentlib:jvmhook&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 18:30:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-session-key-for-Splunk-connect/m-p/355041#M23152</guid>
      <dc:creator>npbala_22</dc:creator>
      <dc:date>2020-09-29T18:30:16Z</dc:date>
    </item>
    <item>
      <title>Re: How to get session key for Splunk connect</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-session-key-for-Splunk-connect/m-p/355042#M23153</link>
      <description>&lt;P&gt;Can you try:&lt;BR /&gt;
    ServiceArgs loginArgs = new ServiceArgs();&lt;BR /&gt;
    loginArgs.setUsername("username");&lt;BR /&gt;
    loginArgs.setPassword("password");&lt;BR /&gt;
    loginArgs.setHost(host);&lt;BR /&gt;
    loginArgs.setPort(Integer.parseInt(port));&lt;BR /&gt;
    Service.connect(loginArgs);&lt;/P&gt;</description>
      <pubDate>Thu, 15 Mar 2018 15:31:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-get-session-key-for-Splunk-connect/m-p/355042#M23153</guid>
      <dc:creator>p_gurav</dc:creator>
      <dc:date>2018-03-15T15:31:27Z</dc:date>
    </item>
  </channel>
</rss>

