Dashboards & Visualizations

Edting dashboard

srajanbabu
Explorer

I created a dashboard displaying certain results out of a search.i want to add show & hide options to the dashboard so that if i click show button results should get displayed and when i click hide button results should not get displayed.

Tags (1)

somesoni2
Revered Legend

One workaround to do this is to include a checkbox in the panel which says "Hide Results". When that checkbox is checked, not results are shown (query modified to return nothing). Its not same as hiding panel, but effect is same. Here is the example implementation.

<view autoCancelInterval="90" isPersistable="true" isSticky="true" isVisible="true" objectMode="SimpleForm" onunloadCancelJobs="true" template="dashboard.html">
    <label>Hide Panel Resutls</label>

    <module name="AccountBar" layoutPanel="appHeader"/>
    <module name="AppBar" layoutPanel="navigationHeader"/>
    <module name="SideviewUtils" layoutPanel="appHeader"/>
    <module name="Message" layoutPanel="messaging">
        <param name="filter">*</param>
        <param name="clearOnJobDispatch">False</param>
        <param name="maxSize">1</param>
    </module>
    <module name="Message" layoutPanel="messaging">
        <param name="filter">splunk.search.job</param>
        <param name="clearOnJobDispatch">True</param>
        <param name="maxSize">1</param>
    </module>

    <module name="Search" layoutPanel="panel_row1_col1" >
        <param name="search">
        YOUR MAIN SEARCH QUERY
        </param>
        <module name="Checkbox" layoutPanel="panel_row1_col1" >
            <param name="name">hideResult</param>
            <param name="checked">False</param>
            <param name="float">left</param>
            <param name="label">Hide Result</param>
            <param name="labelPosition">right</param>
            <param name="offValue">
            |fields foo,bar #some random name so that no field is selected#
            </param>
            <module name="PostProcess">
                <param name="search">
                <![CDATA[
                $hideResult$
                ]]>
                </param>

                <module name="JobProgressIndicator" layoutPanel="panel_row1_col1"></module>
                <module name="Pager">
                    <param name="count">50</param>
                    <module name="SimpleResultsTable">
                    ...                 
                    </module>
                </module>       
            </module>
        </module>
    </module>       
</view>
0 Karma

somesoni2
Revered Legend

This code (and myself) uses Sideview Util app, which provide much more simplified advanced xml for the dashboards. This app is available free in Splunk-base. The code should work after you install the same.

0 Karma

srajanbabu
Explorer

when i tried this code i got something like Splunk encountered unknown module "SideViewutils" so view could not be loaded properly.

Can you please look towards it.

0 Karma

somesoni2
Revered Legend

you might want to explore ShowHideHeader module. It provides options to show or hide the panel on click on the panel

0 Karma

srajanbabu
Explorer

i need in advance XML

0 Karma

Ayn
Legend

Simple XML, advanced XML? If it's simple you'll need to convert to advanced first of all.

0 Karma

srajanbabu
Explorer

i want to hide the panel showing the results

0 Karma

somesoni2
Revered Legend

Just to be clear, you want to hide the panel you're showing results OR just want to show empty table/"No Results found" message in the dashboard panel??

0 Karma
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Take Action Automatically on Splunk Alerts with Red Hat Ansible Automation Platform

 Are you ready to revolutionize your IT operations? As digital transformation accelerates, the demand for ...

Calling All Security Pros: Ready to Race Through Boston?

Hey Splunkers, .conf25 is heading to Boston and we’re kicking things off with something bold, competitive, and ...

Beyond Detection: How Splunk and Cisco Integrated Security Platforms Transform ...

Financial services organizations face an impossible equation: maintain 99.9% uptime for mission-critical ...