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!

Index This | I am a number, but when you add ‘G’ to me, I go away. What number am I?

March 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with another ...

What’s New in Splunk App for PCI Compliance 5.3.1?

The Splunk App for PCI Compliance allows customers to extend the power of their existing Splunk solution with ...

Extending Observability Content to Splunk Cloud

Register to join us !   In this Extending Observability Content to Splunk Cloud Tech Talk, you'll see how to ...