Dashboards & Visualizations

Unauthenticated dashboard

bmacias84
Champion

Hello,

I don’t know about you, but every so often I get the request for a dashboard that does not require a user to authenticate and/or timeout. Prior to 6.x the time out issue could be solved using jscript. Still execs/management do not like to login (It should be like magic doesn’t the system know who I am! Joking just a little). Has anyone found a solution to this yet.

1 Solution

bmacias84
Champion

The easiest way I found was to build django app. where I did not want users to authenticate I created a new view in view.py and remove the @login_required decorator rendered it to a template. I realized this that Splunk use the django framework and should I bide by the same rule and conventions.

  1. Create your django app
  2. Create a template <yourtemplate>.html in $SPLUNK_HOME/<yourapp>/django/<yourapp>/template/
  3. New create a new function in views.py located $SPLUNK_HOME/<yourapp>/django/<yourapp>/


    # Before
    @render_to('<yourapp>: <yourtemplate>.html')
    @login_required
    def <yourtemplate> (request):
    return {
    "message": "Hello World from <yourapp>!",
    "app_name": "<yourapp> :"
    }
    # After
    @render_to('<yourapp>: <yourtemplate>.html')
    def <yourtemplate> (request):
    return {
    "message": "Hello World from <yourapp>!",
    "app_name": "<yourapp> :"
    }

  4. Don’t forget to add the new template to urls.py

View solution in original post

bmacias84
Champion

The easiest way I found was to build django app. where I did not want users to authenticate I created a new view in view.py and remove the @login_required decorator rendered it to a template. I realized this that Splunk use the django framework and should I bide by the same rule and conventions.

  1. Create your django app
  2. Create a template <yourtemplate>.html in $SPLUNK_HOME/<yourapp>/django/<yourapp>/template/
  3. New create a new function in views.py located $SPLUNK_HOME/<yourapp>/django/<yourapp>/


    # Before
    @render_to('<yourapp>: <yourtemplate>.html')
    @login_required
    def <yourtemplate> (request):
    return {
    "message": "Hello World from <yourapp>!",
    "app_name": "<yourapp> :"
    }
    # After
    @render_to('<yourapp>: <yourtemplate>.html')
    def <yourtemplate> (request):
    return {
    "message": "Hello World from <yourapp>!",
    "app_name": "<yourapp> :"
    }

  4. Don’t forget to add the new template to urls.py

woodcock
Esteemed Legend

Did anybody even try this? I am using v6.1.2 and when I got to my django URL (with "@login_required" removed) it does the same as every other Splunk URL: It prompts me to login!

0 Karma

bmacias84
Champion

You could use the Jscript SDK and embed your search. Also you might call a saved search owned by a user. Your best answer is to use the jscript or python sdk and which can uses embedded credentials.

0 Karma

laserval
Communicator

How would you go about running search jobs on this unauthenticated dashboard? I know I was trying it out a while ago and had trouble getting searches to run. I suppose you need to supply a user that can run the searches, but is an unauthenticated session allowed to do that?

0 Karma
Get Updates on the Splunk Community!

Welcome to the Splunk Community!

(view in My Videos) We're so glad you're here! The Splunk Community is place to connect, learn, give back, and ...

Tech Talk | Elevating Digital Service Excellence: The Synergy of Splunk RUM & APM

Elevating Digital Service Excellence: The Synergy of Real User Monitoring and Application Performance ...

Adoption of RUM and APM at Splunk

    Unleash the power of Splunk Observability   Watch Now In this can't miss Tech Talk! The Splunk Growth ...