Refine your search:

3
6

Is it possible to refresh a single module on a dashboard?

A client is interested in having a single dashboard with half static, backward looking charts, and half real-time, forward looking charts. They want to refresh the static ones every so often without losing the real-time graphs' history.

asked 30 Jun '10, 20:52

Jason's gravatar image

Jason
1.6k16
accept rate: 50%

edited 05 May '11, 14:41

jlaw's gravatar image

jlaw ♦
18113


2 Answers:

Yep, it can be done if you're using the advanced XML.

I cant think of an app offhand that does it but im sure there is one. You just put a SubmitButton module into the XML as follows:

Example:
1) an ordinary dashboard panel in the Advanced XML, with no SubmitButton

<module name="HiddenSearch" layoutPanel="panel_row1_col1" group="No SubmitButton.. :(" autoRun="True">
  <param name="search">* | top sourcetype | fields - percent</param>
  <param name="earliest">-30s</param>
  <module name="HiddenChartFormatter">
    <param name="charting.chart">bar</param>
    <param name="charting.primaryAxisTitle.text">Sourcetype</param>
    <param name="charting.secondaryAxisTitle.text">## of events</param>

    <module name="FlashChart">
    </module>

  </module>
</module>

2) same panel, but with a SubmitButton

<module name="HiddenSearch" layoutPanel="panel_row1_col1" group="with the SubmitButton :)" autoRun="True">
  <param name="search">* | top sourcetype | fields - percent</param>
  <param name="earliest">-30s</param>
  <module name="HiddenChartFormatter">
    <param name="charting.chart">bar</param>
    <param name="charting.primaryAxisTitle.text">Sourcetype</param>
    <param name="charting.secondaryAxisTitle.text">## of events</param>

    <module name="SubmitButton">
      <param name="label">Refresh</param>

      <module name="FlashChart">
      </module>
    </module>
  </module>
</module>

Make sure that the module tag for the SubmitButton encloses the FlashChart module and also that it encloses any other modules that will be displaying data for this particular job -- most typically headers. As is always the case with the containment of module tags, if someone isnt enclosed by a module, then they know nothing about that module. So in this example if a SimpleResultsHeader is not enclosed by the SubmitButton, then it wont be refreshed when users click on it.

link

answered 30 Jun '10, 22:04

nick's gravatar image

nick ♦
13.1k1316
accept rate: 46%

edited 30 Jun '10, 22:11

Another option is to add a custom module to splunk that can refresh periodically. Let's call the module AutoRefresh. To do this you have to create the following directory structure (in an app, eg. search or better a custom one):

$SPLUNK_HOME/etc/apps/someapp
| - appserver
   | - modules
      |- AutoRefresh
        | - AutoRefresh.conf
        | - AutoRefresh.css
        | - AutoRefresh.js

AutoRefresh.conf:

[module]
className = Splunk.Module.AutoRefresh
superClass = Splunk.Module
description = This module refreshes it's descending modules periodically.

[param:invervalInSeconds]
required = True
label = This parameters defines the inverval in seconds in which the descending search modules should be reloaded.

AutoRefresh.css:

div.SplunkModule.AutoRefresh { display: none; margin: 0; padding: 0; }

AutoRefresh.js:

Splunk.namespace("Module");
Splunk.Module.AutoRefresh = $.klass(Splunk.Module, {
    initialize: function($super, container) {
        $super(container);
        var interval = (+this._params['invervalInSeconds'])*1000;
        this._timer = setInterval(this.refresh.bind(this), interval);
    },
    refresh: function() {
        this.pushContextToChildren();
    }
});

Once you've added those folders and files you have to restart Splunk. Then you'll be able to use the module in your advanced xml views like this:

... truncated ...

<module name="GenericHeader" layoutPanel="panel_row1_col1">
    <param name="label">Status</param>
    <module name="AutoRefresh">
        <param name="invervalInSeconds">10</param>
        <module name="HiddenSearch" layoutPanel="panel_row1_col1_grp1" autoRun="True">
                    ...
        </module>
    </module>
</module>
...

In this example all (search-)descendants of the AutoRefresh module would be refresh every 10 seconds.

link

answered 30 Jun '10, 22:38

ziegfried's gravatar image

ziegfried ♦
5.8k315
accept rate: 52%

1

Any chance such a module will be built-in in the future?

(01 Jul '10, 14:21) Lowell ♦
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:

×299
×138
×31

Asked: 30 Jun '10, 20:52

Seen: 961 times

Last updated: 05 May '11, 14:41

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