Refine your search:

1
3

I have a special user (her name is "dashboard") that needs a session timeout of 0. Is it possible to set no timeout for a specific user?

asked 24 Sep '10, 17:58

the_wolverine's gravatar image

the_wolverine ♦
4.3k5843
accept rate: 50%


2 Answers:

As far as I'm aware it's not possible as a configuration option per-user, but that doesn't mean you can't do it. :-)

Need to think this through a little more, but you should be able to do something along these lines:

  • Create a separate app called dashboard.

  • Set your new dashboard app as the default app for that user, either via Manager->Access Controls->Users or via user_prefs.conf.

  • Make sure that all of your required dashboard views are accessible through that app context. (Either copy them, or set them to global scope)

  • Paste the following into application.js for that app:

    $(document).ready(function() {
        Splunk.Session.instance.UI_INACTIVITY_TIMEOUT = 0;
        Splunk.Session.instance.timeoutDelay = 0;
    
        function overrideStartTimeout() {
            return;
        }
        Splunk.Session.instance.startTimeout = overrideStartTimeout;
        Splunk.Session.instance.stopTimeout();
    });
    

    If you really want to do it within another app like search, you can do the same thing, but wrap it in an if statement that checks the username. Getting the username may be non-trivial - usually it shows an auth token but not a name. If you have an AccountBar module, you can get it from there; if not, it may be hiding somewhere in the DOM, but I haven't seen it.

    I still think, however, that compartmentalizing into a dedicated app is less risky.

    lastKnownUser = 'unknown'
    
    function getUserName() {
        // Only works for pages that have an AccountBar module
        text = jQuery('.accountBarItems').text()
        r = /Logged in as (\S+)/
        matches = r.exec(text)
        if (matches) {
            lastKnownUser = matches[1];
        }
        return lastKnownUser;
    }
    
    $(document).ready(function() {
        if ( getUserName() == "dashboard" ) {
            Splunk.Session.instance.UI_INACTIVITY_TIMEOUT = 0;
            Splunk.Session.instance.timeoutDelay = 0;
    
            function overrideStartTimeout() {
                return;
            }
            Splunk.Session.instance.startTimeout = overrideStartTimeout;
            Splunk.Session.instance.stopTimeout();
        }
    });
    
  • link

    answered 03 Oct '10, 15:50

    southeringtonp's gravatar image

    southeringtonp ♦
    4.5k1215
    accept rate: 35%

    edited 03 Oct '10, 19:00

    Judging from http://www.splunk.com/base/Documentation/4.1.5/Admin/Configureusertimeouts,

    In addition to setting the splunkweb/splunkd session value, you can also specify the timeout for the user browser session by editing the ui_inactivity_timeout value in web.conf. The Splunk browser session will time out once this value is reached. The default is 60 minutes. If ui_inactivity_timeout is set to less than 1, there's no timeout -- the session will stay alive while the browser is open.

    But I'm not sure that can be applied to specific users or not..

    link

    answered 03 Oct '10, 14:01

    Brian%20Osburn's gravatar image

    Brian Osburn
    2.8k14
    accept rate: 22%

    Post your answer
    toggle preview

    Follow this question

    Log In to enable email subscriptions

    RSS:

    Answers

    Answers + Comments

    Markdown Basics

    • *italic* or _italic_
    • **bold** or __bold__
    • link:[text](http://url.com/ "Title")
    • image?![alt text](/path/img.jpg "Title")
    • numbered list: 1. Foo 2. Bar
    • to add a line break simply add two spaces to where you would like the new line to be.
    • basic HTML tags are also supported

    Tags:

    ×20
    ×16
    ×9

    Asked: 24 Sep '10, 17:58

    Seen: 1,577 times

    Last updated: 03 Oct '10, 19:00

    Copyright © 2005-2012 Splunk, Inc. All rights reserved.