Dashboards & Visualizations

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

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

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

Motivator

Hi! Could you post the initial form?

0 Karma

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
State of Splunk Careers

Access the Splunk Careers Report to see real data that shows how Splunk mastery increases your value and job satisfaction.

Find out what your skills are worth!