Dashboards & Visualizations

How to apply dynamic visibility for table columns in splunk dashboards?

kavyaa
Explorer

Hi,

I have created sample dashboard . In that 14 columns there. I want hide last 5 cloumns dynamically and I want show 5 cloumns dynamically. Is it possible?. How it will work?. My idea is same as below 2nd image . Please check it once. Please help me. Thanks in advance.
The query as follows

**| dbquery "WHCMB" "SELECT *business_date, company code , line_no , oracle_gl,  contract_code, apl_code, customer_id, currency, balance,ccy_balance,product code, branch, asset_type from EFZ_VIEW_DWT__GL_BAL" limit=10**

alt text

alt text

0 Karma

srisahitya_v
Communicator

go to dashboard examples and find dashboard"multiple check box". there you will get code and using appropriate modifications in fields you can randomly hide/show columns in dashboard.

for your reference , find code below:

<form>
      <label>Check Box Input</label>
      <description/>
      <row>
        <panel>
          <!-- New in Splunk 6.1 use the checkbox input -->
          <input type="checkbox" token="sourcetype_token" searchWhenChanged="true">
            <choice value="*">ANY</choice>
            <default>*</default>
            <!-- The final value will be surrounded by prefix and suffix -->
            <prefix>(</prefix>
            <suffix>)</suffix>
            <!-- Each value will be surrounded by the valuePrefix and valueSuffix -->
            <valuePrefix>sourcetype="</valuePrefix>
            <valueSuffix>"</valueSuffix>
            <!-- All the values and their valuePrefix and valueSuffix will be concatenated together with the delimiter between them -->
            <delimiter> OR </delimiter>
            <populatingSearch earliest="-60m@m" latest="now" fieldForLabel="sourcetype" fieldForValue="sourcetype">index=_internal | stats count by sourcetype</populatingSearch>
          </input>
          <chart>
            <title>Multi Value Search</title>
            <searchString>index=_internal $sourcetype_token$ | stats count by sourcetype</searchString>
            <earliestTime>-60m@m</earliestTime>
            <latestTime>now</latestTime>
          </chart>
        </panel>
      </row>
    </form> 

in above code, "sourcetype" is vary ( we can select sourcetype dynamically). change sourcetype to your required field.

0 Karma

kavyaa
Explorer

I have seen previously. In that dashboard examples, hide/ show selection option for number of rows for single column(source type)... Idid that one. My requirement is selection option for Table column names. not for rows. My query is

***| dbquery "WHCMB" "SELECT *business_date, company code , line_no , oracle_gl,  contract_code, apl_code, customer_id, currency, balance,ccy_balance,product code, branch, asset_type from EFZ_VIEW_DWT__GL_BAL" limit=10****

I want to put check boxes for **business_date, company code , line_no , oracle_gl, contract_code, apl_code, customer_id, currency, balance,ccy_balance,product code, branch, asset_type** 13 column names . see above posted image. Please help me. Thanks in advance. A.kavya

0 Karma

srisahitya_v
Communicator

elaborate your question please.

As per my view, you can use check boxes (or) drop-down boxes to show/hide columns dynamically.

0 Karma

kavyaa
Explorer

As your wish, either dropdown or checkbox. But I want to hide& show cloumns dynamically . Please help me.

0 Karma
Get Updates on the Splunk Community!

Developer Spotlight with Paul Stout

Welcome to our very first developer spotlight release series where we'll feature some awesome Splunk ...

State of Splunk Careers 2024: Maximizing Career Outcomes and the Continued Value of ...

For the past four years, Splunk has partnered with Enterprise Strategy Group to conduct a survey that gauges ...

Data-Driven Success: Splunk & Financial Services

Splunk streamlines the process of extracting insights from large volumes of data. In this fast-paced world, ...