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
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

A Four-Part Event Series: Full Stack Observability For the AI Era

As AI reshapes applications, infrastructure, and the way teams operate, the traditional boundaries of ...

SOC4Kafka - New Kafka Connector Powered by OpenTelemetry

The new SOC4Kafka connector, built on OpenTelemetry, enables the collection of Kafka messages and forwards ...

Event Series: Level up your SOC: Advancing with Splunk Enterprise Security

AI has fundamentally raised the stakes for security operations, and this three-part series is your guide to ...