Dashboards & Visualizations

Token unset issue for dynamic dropdown

jsanjeb
Explorer

Hi Splunkers,

I have 2 panels, on click of panel1 drill down to panel2 and clicked value will be passed as token. And I have unset this clicked value everytime user changes input criteria so that fresh drill down happens for panel 2 (depends on clicked value token). But I see that clicked toke is getting unset even if inputs are not changes, as a result of which panel2 appears and disappears within a second. Please help.

Source code,

<form>
  <search id="fieldParametersBase">
    <query>$baseQuery$ | stats values(SourceApplication) as SourceApplication, values(BusinessObject) as BusinessObject, values(DestinationApplication) as DestinationApplication, values(Platform) as Platform by Interface</query>
    <earliest>$time_tok.earliest$</earliest>
    <latest>$time_tok.latest$</latest>
  </search>
  <label>JCI EI Business Logging Framework</label>
  <init>
    <set token="baseQuery">index="ei_*_wmb" OR index="ei_wmb_idx"</set>
  </init>
  <fieldset submitButton="true">
    <input type="time" searchWhenChanged="false" token="time_tok">
      <label>Select Time</label>
      <default>
        <earliest>-24h@h</earliest>
        <latest>now</latest>
      </default>
      <change>
        <unset token="clicked_tok"></unset>
      </change>
    </input>
    <input type="dropdown" searchWhenChanged="false" token="interface_tok">
      <label>Interface</label>
      <fieldForLabel>Interface</fieldForLabel>
      <fieldForValue>Interface</fieldForValue>
     <search base="fieldParametersBase">
        <query>stats count by Interface | sort Interface | table Interface
        </query>
      </search>
      <default>*</default>
      <choice value="*">ALL</choice>
      <change>
        <unset token="clicked_tok"></unset>
      </change>
    </input>
    <input type="dropdown" searchWhenChanged="false" token="source_tok">
      <label>Source</label>
      <fieldForLabel>SourceApplication</fieldForLabel>
      <fieldForValue>SourceApplication</fieldForValue>
      <search base="fieldParametersBase">
        <query>search Interface="$interface_tok$" | stats count by SourceApplication</query>
      </search>
      <default>*</default>
      <choice value="*">ALL</choice>
      <change>
        <unset token="clicked_tok"></unset>
      </change>
    </input>

  </fieldset>
  <row>
    <panel>
      <title>EI Interface Tracking</title>
      <input type="dropdown" token="row_tok" searchWhenChanged="true">
        <label>Rows per page</label>
        <choice value="5">5</choice>
        <choice value="10">10</choice>
        <choice value="15">15</choice>
        <choice value="20">20</choice>
        <default>5</default>
      </input>
      <table>
        <search>
          <query>$baseQuery$

          | search Interface="$interface_tok$" AND SourceApplication="$source_tok$" AND BusinessObject="$bo_tok$" AND DestinationApplication="$destination_tok$" AND Environment="$environment_tok$" AND $name_tok1$="$value_tok1$" AND $name_tok2$="$value_tok2$" AND $name_tok3$="$value_tok3$"
          | dedup UniqueID
          | rename BusinessObject AS "Business Object", ExecutionStep AS "Execution Step", SourceApplication AS "Source", DestinationApplication AS "Destination", RecordsFetched AS "Records Fetched", StartDateTime AS "Start Date", EndDateTime AS "End Date", FlowName AS "Flow Name"
          | table UniqueID, "Business Object",  "Environment", "Status", "Execution Step", "Source", "Destination", "Flow Name", "Records Fetched", "Platform", $name_tok1$, $name_tok2$,  $name_tok3$, "Start Date", "End Date"
          | sort "Start Date"</query>
          <earliest>$time_tok.earliest$</earliest>
          <latest>$time_tok.latest$</latest>
          <sampleRatio>1</sampleRatio>
        </search>
        <option name="count">$row_tok$</option>
        <option name="dataOverlayMode">none</option>
        <option name="drilldown">row</option>
        <option name="percentagesRow">false</option>
        <option name="rowNumbers">true</option>
        <option name="totalsRow">false</option>
        <option name="wrap">false</option>
        <drilldown>
          <condition field="UniqueID">
            <set token="clicked_tok">$click.value$</set>
          </condition>
          <condition field="*"></condition>
        </drilldown>
      </table>
    </panel>
  </row>
  <row>
    <panel depends="$clicked_tok$">
      <table>
        <title>EI Interface Detailed Tracking of UniqueID : "$clicked_tok$"</title>
        <search>
          <query>$baseQuery$
          | search Interface="$interface_tok$" AND UniqueID="$clicked_tok$"
          | rename BusinessObject AS "Business Object", ExecutionStep AS "Execution Step", SourceApplication AS "Source", DestinationApplication AS "Destination", RecordsFetched AS "Records Fetched", StartDateTime AS "Start Date", EndDateTime AS "End Date", FlowName AS "Flow Name"
          | table UniqueID, "Business Object",  "Environment", "Status", "Execution Step", "Source", "Destination", "Flow Name", "Records Fetched", "Platform", $name_tok1$, $name_tok2$,  $name_tok3$, "Start Date", "End Date"
          | sort "Execution Step"</query>
          <earliest>$time_tok.earliest$</earliest>
          <latest>$time_tok.latest$</latest>
        </search>
        <option name="count">5</option>
        <option name="drilldown">row</option>
        <option name="rowNumbers">true</option>
        <option name="wrap">false</option>
        <drilldown>
          <condition field="*"></condition>
        </drilldown>
      </table>
    </panel>
  </row>

</form>

Screen shot,

alt text

Thanks in advance.

Tags (1)
0 Karma

elliotproebstel
Champion

I've read through the dashboard XML several times and can't directly identify a logic error that would cause what you're describing, so I'd recommend simplifying matters in order to troubleshoot. If I were in your shoes, I'd first comment out each of the <unset> elements to ensure that there wasn't something totally else causing the issue. If the panel still appears and immediately disappears, then there's something less obvious happening. If not, then try adding the <unset> elements back one at a time to narrow down which one is causing the problem. There may be a hidden logic dependency that I'm just not able to trace by reading the XML. 🙂

0 Karma

jsanjeb
Explorer

Hi elliotproebstel, I have tried that approach which you have suggested but no luck. The drilldown is not working when i added the first unset itself. If no unset is added then it is working fine. But unset functionality is required for this dashboard.

0 Karma

elliotproebstel
Champion

I understand that you'll need the <unset> logic to make the dashboard work as intended. This is just for troubleshooting. So if you remove all of the unset tags, then the page loads with the final panel hidden, and when you click to display it - it appears. Right? If so, that's a great first place to be.

Now, try adding back in each unset token separately - the goal is to see if any single one causes the flicker. So first add the very first unset, then remove it and add the second, and then remove that and add the third. I suspect that something is causing one to update automatically, and hopefully not all three! Can you test each one and post an update here? It will likely help us isolate the part of the code that is causing the problem.

0 Karma

jsanjeb
Explorer

I tried the approach which you have suggested. Tried adding unset for one input at a time. But its failing. unset in all inputs is causing this issue.

0 Karma
Get Updates on the Splunk Community!

Splunk Mobile: Your Brand-New Home Screen

Meet Your New Mobile Hub  Hello Splunk Community!  Staying connected to your data—no matter where you are—is ...

Introducing Value Insights (Beta): Understand the Business Impact your organization ...

Real progress on your strategic priorities starts with knowing the business outcomes your teams are delivering ...

Enterprise Security (ES) Essentials 8.3 is Now GA — Smarter Detections, Faster ...

As of today, Enterprise Security (ES) Essentials 8.3 is now generally available, helping SOC teams simplify ...