Dashboards & Visualizations

How to remove label from dropdown?

jangid
Builder

I have created a form based panel according to http://docs.splunk.com/Documentation/Splunk/latest/Developer/AddDropDowns

Above drop down there a Label, I want to remove this Label how do I?

Thanks

Tags (3)
0 Karma
1 Solution

MHibbin
Influencer

If you convert your form to advanced XML (you can do this by appending ?showsource=1 to the view's URL). Copy this to NEW view (through the manager), and call it something like yourViewAdv to differentiate between the original and the new.

Then in your new advanced XML there will be a line similar to the following...

enterWord

Simply replace the "enterWord" (whatever it will be in your case) with a space " ".

You could also put an application.css file in your "$SPLUNK_HOME/etc/apps/<yourApp>/appserver/static/" directory (replace "<yourApp>" with the name of your app, if this is the default app, this will be "search"). with the following contents. This will simply hide the text...

.splFormSearch .ExtendedFieldSearch label {
    font-size: 0;
}

You also apply a specific CSS file (e.g. yourForm.css in the App's appserver/static directory) to the view in advanced XML, to avoid affecting the whole app. This can be done by adding the following to the "<view>" tag in the advanced XML...

stylesheet="yourForm.css"

Hope this helps,

Regards,

MHibbin

View solution in original post

MHibbin
Influencer

If you convert your form to advanced XML (you can do this by appending ?showsource=1 to the view's URL). Copy this to NEW view (through the manager), and call it something like yourViewAdv to differentiate between the original and the new.

Then in your new advanced XML there will be a line similar to the following...

enterWord

Simply replace the "enterWord" (whatever it will be in your case) with a space " ".

You could also put an application.css file in your "$SPLUNK_HOME/etc/apps/<yourApp>/appserver/static/" directory (replace "<yourApp>" with the name of your app, if this is the default app, this will be "search"). with the following contents. This will simply hide the text...

.splFormSearch .ExtendedFieldSearch label {
    font-size: 0;
}

You also apply a specific CSS file (e.g. yourForm.css in the App's appserver/static directory) to the view in advanced XML, to avoid affecting the whole app. This can be done by adding the following to the "<view>" tag in the advanced XML...

stylesheet="yourForm.css"

Hope this helps,

Regards,

MHibbin

jangid
Builder

Thanks MHibbin,

It means there is no direct way to achieve this.
Yes I can do this.

Thanks Again 🙂

0 Karma

MHibbin
Influencer

If you don't wish to use advanced XML (which will give you lots of additional functionality), I would use the application.css file method to hide the text. You can the use CSS to modify the display of on-screen components (e.g. the search button) by "moving" them. You can use firebug to really look into the CSS modifications.

0 Karma

jangid
Builder

Thanks MHibbin,

I am building only basic dashboard, here is my XML

<fieldset autoRun="true">
    <input type="time" searchWhenChanged="true">
    </input>
    <input type="dropdown" token="JT_JOB">
        <populatingSearch fieldForValue="JT_JOB" fieldForLabel="JT_JOB">
            <![CDATA[eventtype=counters | table JT_JOB | dedup JT_JOB | sort JT_JOB ]]>
        </populatingSearch>
    </input>
</fieldset> 

If I keep label blank then alignment will disturb [time and dropdown will not be in single row], if I remove Label then splunk will use default label in this case JT_JOB.

0 Karma
Get Updates on the Splunk Community!

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...