Dashboards & Visualizations

Editing Splunk Dashboard after converting to HTML

nkankur
Path Finder

Hi all,

I am using SPLUNK 7.0.0
I have converted my dashboard into html to make some changes to the layout

I have a piece of code as given below

<div id="panel6" class="dashboard-cell" style="width: 20%;">
            <div class="dashboard-panel clearfix">
                <h2 class="panel-title">Value</h2>

                <div class="panel-element-row">
                    <div id="element6" class="dashboard-element single" style="width: 100%">
                        <div class="panel-body"></div>
                    </div>
                </div>
            </div>
        </div>

I want to change the width of the panel from 20% to 50% hence I added the below code and adjusted the width of other panels accordingly.

<div id="panel6" class="dashboard-cell" style="width: 50% !important;">
            <div class="dashboard-panel clearfix">
                <h2 class="panel-title">Value</h2>

                <div class="panel-element-row">
                    <div id="element6" class="dashboard-element single" style="width: 100%">
                        <div class="panel-body"></div>
                    </div>
                </div>
            </div>
        </div>

After saving it nothing changes
although in the source code i can still see the updated code.

0 Karma
1 Solution

Can you try overriding the style using panel ids?

<style>
      #errorSinglePanel{
      width:25% !important;
      }
      #errorStatsPanel{
      width:30% !important;
      }
      #errorLineChartPanel{
      width:45% !important;
      }
</style>
<div class="dashboard-body container-fluid main-section-body" data-role="main">
    <div class="dashboard-header clearfix">
        <h2>Adjust Width of Panels in Dashboard HTML</h2>
    </div>
    <div class="fieldset">
        <div class="input input-timerangepicker" id="input1">
            <label>Select Time</label>
        </div>
    </div>
    <div id="row1" class="dashboard-row dashboard-row1">
        <div id="errorSinglePanel" class="dashboard-cell" style="width: 33.5%;">
            <div class="dashboard-panel clearfix">
                <h2 class="panel-title">Splunkd Errors (Single Value)</h2>

                <div class="panel-element-row">
                    <div id="element2" class="dashboard-element single" style="width: 100%">
                        <div class="panel-body"></div>
                    </div>
                </div>
            </div>
        </div>
        <div id="errorStatsPanel" class="dashboard-cell" style="width: 33.5%;">
            <div class="dashboard-panel clearfix">
                <h2 class="panel-title">Top 5 Error (Stats)</h2>
                <div class="panel-element-row">
                    <div id="element3" class="dashboard-element table" style="width: 100%">
                        <div class="panel-body"></div>
                    </div>
                </div>
            </div>
        </div>
        <div id="errorLineChartPanel" class="dashboard-cell" style="width: 33.5%;">
            <div class="dashboard-panel clearfix">
                <h2 class="panel-title">Splunkd Errors (Timechart)</h2>
                <div class="panel-element-row">
                    <div id="element4" class="dashboard-element chart" style="width: 100%">
                        <div class="panel-body"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

Can you try overriding the style using panel ids?

<style>
      #errorSinglePanel{
      width:25% !important;
      }
      #errorStatsPanel{
      width:30% !important;
      }
      #errorLineChartPanel{
      width:45% !important;
      }
</style>
<div class="dashboard-body container-fluid main-section-body" data-role="main">
    <div class="dashboard-header clearfix">
        <h2>Adjust Width of Panels in Dashboard HTML</h2>
    </div>
    <div class="fieldset">
        <div class="input input-timerangepicker" id="input1">
            <label>Select Time</label>
        </div>
    </div>
    <div id="row1" class="dashboard-row dashboard-row1">
        <div id="errorSinglePanel" class="dashboard-cell" style="width: 33.5%;">
            <div class="dashboard-panel clearfix">
                <h2 class="panel-title">Splunkd Errors (Single Value)</h2>

                <div class="panel-element-row">
                    <div id="element2" class="dashboard-element single" style="width: 100%">
                        <div class="panel-body"></div>
                    </div>
                </div>
            </div>
        </div>
        <div id="errorStatsPanel" class="dashboard-cell" style="width: 33.5%;">
            <div class="dashboard-panel clearfix">
                <h2 class="panel-title">Top 5 Error (Stats)</h2>
                <div class="panel-element-row">
                    <div id="element3" class="dashboard-element table" style="width: 100%">
                        <div class="panel-body"></div>
                    </div>
                </div>
            </div>
        </div>
        <div id="errorLineChartPanel" class="dashboard-cell" style="width: 33.5%;">
            <div class="dashboard-panel clearfix">
                <h2 class="panel-title">Splunkd Errors (Timechart)</h2>
                <div class="panel-element-row">
                    <div id="element4" class="dashboard-element chart" style="width: 100%">
                        <div class="panel-body"></div>
                    </div>
                </div>
            </div>
        </div>
    </div>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

p_gurav
Champion

You can reload these from disk using the following endpoint(s).

To reload all objects:

http://splunkinstanceip:8000/debug/refresh

To reload views only:

http://splunkinstanceip:8000/debug/refresh?entity=%2Fdata%2Fui%2Fnav&entity=%2Fdata%2Fui%2Fviews
0 Karma
Get Updates on the Splunk Community!

Register to Attend BSides SPL 2022 - It's all Happening October 18!

Join like-minded individuals for technical sessions on everything Splunk!  This is a community-led and run ...

What's New in Splunk Cloud Platform 9.0.2208?!

Howdy!  We are happy to share the newest updates in Splunk Cloud Platform 9.0.2208! Analysts can benefit ...

Admin Console: A Single, Unified Interface for All Your Cloud Admin Needs

WATCH NOWJoin us to learn how the admin console can save you time and give you more control over the Splunk® ...