<?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: How do I know the login status in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162060#M9978</link>
    <description>&lt;P&gt;Could you please give me an example of this?&lt;/P&gt;

&lt;P&gt;The only way to determine whether the session is still valid is to make a request and see whether it succeeds.&lt;/P&gt;</description>
    <pubDate>Mon, 02 Dec 2013 22:15:13 GMT</pubDate>
    <dc:creator>junwhuan</dc:creator>
    <dc:date>2013-12-02T22:15:13Z</dc:date>
    <item>
      <title>How do I know the login status</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162054#M9972</link>
      <description>&lt;P&gt;Hello all,&lt;/P&gt;

&lt;P&gt;I'm currently using java sdk to login splunk. How do I know the login status? Is there any session expiration time? If the login status is expired, I then can re-login it. Otherwise I don't want to login Splunk each time I do the searches. &lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2013 14:45:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162054#M9972</guid>
      <dc:creator>junwhuan</dc:creator>
      <dc:date>2013-12-02T14:45:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I know the login status</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162055#M9973</link>
      <description>&lt;P&gt;Could you try using service.getToken method. I believe if session is expired, it should return null (or throw exception). Haven't verified it.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2013 15:12:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162055#M9973</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-12-02T15:12:42Z</dc:date>
    </item>
    <item>
      <title>Re: How do I know the login status</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162056#M9974</link>
      <description>&lt;P&gt;I didn't try it. But I will try it now. Do they have documentation for the token?&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2013 15:23:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162056#M9974</guid>
      <dc:creator>junwhuan</dc:creator>
      <dc:date>2013-12-02T15:23:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do I know the login status</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162057#M9975</link>
      <description>&lt;P&gt;Nothing much on documentation, but by description of the method, worth a try (gut feeling it might work)&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2013 17:29:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162057#M9975</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2013-12-02T17:29:30Z</dc:date>
    </item>
    <item>
      <title>Re: How do I know the login status</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162058#M9976</link>
      <description>&lt;P&gt;Sessions expire after a certain amount of time - 60 minutes by default.&lt;/P&gt;

&lt;P&gt;The only way to determine whether the session is still valid is to make a request and see whether it succeeds.&lt;/P&gt;

&lt;P&gt;The Service.getToken() method that was mentioned by others will give you the current session token that is being used but it won't tell you whether it is valid or not. The Service object doesn't actually know whether it is still valid until a new request is made. Even after a timeout occurs the existing token isn't changed (or blanked out) until Server.login() is called again.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2013 22:12:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162058#M9976</guid>
      <dc:creator>dfoster_splunk</dc:creator>
      <dc:date>2013-12-02T22:12:15Z</dc:date>
    </item>
    <item>
      <title>Re: How do I know the login status</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162059#M9977</link>
      <description>&lt;P&gt;It doesn't work. The token will be fetched locally. Even I log out.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2013 22:12:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162059#M9977</guid>
      <dc:creator>junwhuan</dc:creator>
      <dc:date>2013-12-02T22:12:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do I know the login status</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162060#M9978</link>
      <description>&lt;P&gt;Could you please give me an example of this?&lt;/P&gt;

&lt;P&gt;The only way to determine whether the session is still valid is to make a request and see whether it succeeds.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2013 22:15:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162060#M9978</guid>
      <dc:creator>junwhuan</dc:creator>
      <dc:date>2013-12-02T22:15:13Z</dc:date>
    </item>
    <item>
      <title>Re: How do I know the login status</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162061#M9979</link>
      <description>&lt;P&gt;If you need to make an explicit check, something like the following should work:&lt;/P&gt;

&lt;P&gt;service.getServiceInfo().getServerName(); // throws SplunkException if session invalid&lt;/P&gt;

&lt;P&gt;However note that the session may time out by the time you send the next request. Therefore such an explicit check cannot reliably tell you whether a subsequent request will succeed.&lt;/P&gt;

&lt;P&gt;A more robust solution is to harden any code that talks to Splunk to handle session timeouts, relogin if necessary, and reperform the request.&lt;/P&gt;</description>
      <pubDate>Mon, 02 Dec 2013 22:28:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-I-know-the-login-status/m-p/162061#M9979</guid>
      <dc:creator>dfoster_splunk</dc:creator>
      <dc:date>2013-12-02T22:28:41Z</dc:date>
    </item>
  </channel>
</rss>

