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 Ways To Control Your Costs With Archived Metrics | Register for Tech Talk

Tuesday, May 14, 2024  |  11AM PT / 2PM ET Register to Attend Join us for this Tech Talk and learn how to ...

.conf24 | Personalize your .conf experience with Learning Paths!

Personalize your .conf24 Experience Learning paths allow you to level up your skill sets and dive deeper ...

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 ...