Dashboards & Visualizations

How to set a token in XML which is not displayed on table ??

nagendra008
Explorer

Dear experts,

I wan't to set a token in xml which is not displayed on table .
My requirement :

my_search | .... | eval key = "12345$" | table index , source

But i want to set a token in dashboard.xml as

<set token="Key1">$row.key$</set>

Is there any way ??

Regards,
Nagee.

Tags (3)
0 Karma
1 Solution

bruceclarke
Contributor

You can do this using the <fields> XML element. There is an example below. Notice that we have key in the list of fields we table, but leave it out in the <fields> element.

    <panel>
      <title>Hide key field, but allow drilldown</title>
      <table>
        <search>
          <query>my_search | ... | eval key = "12345$" | table index , source, key</query>
        </search>
        <option name="drilldown">row</option>
        <drilldown>
          <condition field="*">
            <set token="Key1">$row.key$</set>
          </condition>
        </drilldown>
        <fields>index, source</fields>
      </table>
    </panel>

View solution in original post

bruceclarke
Contributor

You can do this using the <fields> XML element. There is an example below. Notice that we have key in the list of fields we table, but leave it out in the <fields> element.

    <panel>
      <title>Hide key field, but allow drilldown</title>
      <table>
        <search>
          <query>my_search | ... | eval key = "12345$" | table index , source, key</query>
        </search>
        <option name="drilldown">row</option>
        <drilldown>
          <condition field="*">
            <set token="Key1">$row.key$</set>
          </condition>
        </drilldown>
        <fields>index, source</fields>
      </table>
    </panel>

nagendra008
Explorer

Thanks bruceclarke , it works fine, It was really appreciated.

Regards,
Nagee

0 Karma
Get Updates on the Splunk Community!

Threat Hunting Unlocked: How to Uplevel Your Threat Hunting With the PEAK Framework ...

WATCH NOWAs AI starts tackling low level alerts, it's more critical than ever to uplevel your threat hunting ...

Splunk APM: New Product Features + Community Office Hours Recap!

Howdy Splunk Community! Over the past few months, we’ve had a lot going on in the world of Splunk Application ...

Index This | Forward, I’m heavy; backward, I’m not. What am I?

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