Dashboards & Visualizations

How do you update the value of a token in an init block?

tonydidato
New Member

Using 6.6.2, I have a form that receives a token via a link from another form. The initial form has a grand total field called Total. When the user clicks on that value, I want the resulting form to translate Total to * so that it can be used in a search. Here's one of the many ways I have tried to accomplish this:

  <init>
    <eval token="form.Region">replace($form.Region$,"Total","*")</eval>
  </init>

No matter how I format the eval statement (like, match, etc), it doesn't execute. I have even tried placing the eval statement in the initial form after the drilldown and before the link, and I still can't modify the token value.

Tags (2)
0 Karma

whrg
Motivator

This is much trickier than I thought.
Apparently it is not working to use form tokens in the init section.

I got it working by putting the eval token section in the search of the drilldown dashboard:

<panel>
  <table>
    <title>...</title>
    <search>
      <query>...$form.Region$...</query>
      <progress>
        <eval token="form.Region">replace($form.Region$,"Total","*")</eval>
      </progress>
    </search>

Alternatively, which might be the better solution: Use a done section in the initial search to set a token which you use to populate the drilldown:

<panel>
  <table>
    <search>
      <query>...</query>
      <done>
        <eval token="Region">replace($click.value$,"Total","*")</eval>
      </done>
    </search>
    <option name="count">10</option>
    <drilldown>
      <link target="_blank">...form.Region=$Region$</link>
    </drilldown>
0 Karma

whrg
Motivator

Hi! Could you post the initial form?

0 Karma

tonydidato
New Member

This is the drill down section from the initial form:

       <drilldown>
          <link target="_blank">/app/coo/by_bu?form.Region=$click.value$&amp;form.BU=$bu_dropdown$&amp;form.VM_DXC=$VM_DXC$</link>
        </drilldown>
0 Karma
Get Updates on the Splunk Community!

More Control Over Your Monitoring Costs with Archived Metrics!

What if there was a way you could keep all the metrics data you need while saving on storage costs?This is now ...

New in Observability Cloud - Explicit Bucket Histograms

Splunk introduces native support for histograms as a metric data type within Observability Cloud with Explicit ...

Updated Team Landing Page in Splunk Observability

We’re making some changes to the team landing page in Splunk Observability, based on your feedback. The ...