Splunk Enterprise

Xml link token not passing value after first click

DataOrg
Builder

the token value "*" is passed on the first click after page loads  but not working afterwards and not passing the token value *.

how to fix it?

@kamlesh_vaghela @BSplunk 

 

 

 

<input type="link" value="link4">
                <label>Choose a sourcetype:</label>
                <choice value="link4">Internal Event Count</choice>
                 <change>
                    <condition value="link4">
                      <set token="SELECTED_PU">*</set>
                      <set token="SELECTED_PL">*</set>
                     </condition>
                  </change>
            </input>

 

 

 

Labels (1)
Tags (3)
0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Happy Diwali  @DataOrg 

You can add blank condition to reset or unset the value.

For unset.

 

<change>
    <condition value="link4">
      <set token="SELECTED_PU">*</set>
      <set token="SELECTED_PL">*</set>
     </condition>
     
     <!-- YOU CAN UNSET VALUES -->
     <condition>
	  	<unset token="SELECTED_PU"></unset>
	  	<unset token="SELECTED_PL"></unset>
     </condition>
</change>

OR

For setting up another value.

<change>
    <condition value="link4">
      <set token="SELECTED_PU">*</set>
      <set token="SELECTED_PL">*</set>
     </condition>

     <!-- YOU CAN SET OTHER VALUE -->
     <condition>
	     <set token="SELECTED_PU">AnotherValue</set>
		 <set token="SELECTED_PL">AnotherValue</set>
	 </condition>
</change>

 

🙂

0 Karma

DataOrg
Builder

@kamlesh_vaghela Happy Diwali 🙂

i tried both the cases but the problem i faced here is .

At first time token gets reset to * value but when i pass other value from drilldown and try resetting values its not getting applied.

Actually its works on first click after page reloads and next time its not passing value to reset "*"

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust

Can you please share sample xml if possible?

0 Karma

DataOrg
Builder

@kamlesh_vaghela .below is the XML.

the token gets reset on first click but not working on the next click.

 

  <row>
    <panel depends="$TREEMAP$">
            <input type="link" searchWhenChanged="true">
        <label>test</label>
        <choice value="RESET_TOKEN">Reset</choice>
        <change>
          <condition value="RESET_TOKEN">
            <set token="TOKEN1">*</set>
            <set token="TOKEN2">*</set>
          </condition>
          <condition>
            <set token="TOKEN1">"*"</set>
            <set token="TOKEN2">"*"</set>
          </condition>
        </change>
      </input>
      <viz type="treemap_app.treemap">
        <title>plant count</title>
        <search base="base1">
          <done>
            <condition match="'job.resultCount' &gt; 0">
              <set token="TREEMAP">true</set>
            </condition>
            <condition>
              <unset token="TREEMAP">true</unset>
            </condition>
          </done>
          <done>
            <set token="TOKEN1">*</set>
            <set token="TOKEN2">*</set>
          </done>
          <query>
		  </query>
        </search>
        <option name="drilldown">all</option>
          <drilldown>
          <set token="TOKEN1">$row.VAL1$</set>
          <set token="TOKEN2">$row.VAL2$</set>
        </drilldown>
      </viz>
      </panel>
  </row>
<row>
<panel>
<table>
<query>
</query>|makeresults| $TOKEN1$  $TOKEN2$
</table>
</panel>
</row>

 

0 Karma

kamlesh_vaghela
SplunkTrust
SplunkTrust
Hello @DataOrg
I tried to replicate it with your provided XML but no luck. Is it possible to provide full XML, with masking on sensitive data?

🙂
0 Karma

DataOrg
Builder

Hello @kamlesh_vaghela 

Pls try with the XML.
drilldown>treemap(zoomin) > click tile>
>table will be populated with the token value>after click  reset button will set to "*"

>try same for next time will not reset value to *

 

 

<form>
  <label>model dashboard</label>
  <fieldset submitButton="false"></fieldset>
  <row>
    <panel >
      <input type="link" searchWhenChanged="true">
        <label></label>
        <choice value="link4">Reset</choice>
        <change>
          <condition value="link4">
            <set token="SELECTED_PU">*</set>
            <set token="SELECTED_PL">*</set>
          </condition>
          <condition>
            <set token="SELECTED_PU">"*"</set>
            <set token="SELECTED_PL">"*"</set>
          </condition>
        </change>
      </input>
      <viz type="treemap_app.treemap">
        <title>"$SELECTED_PL$"      "$SELECTED_PU$"</title>
        <search>
          <done>
            <condition match="'job.resultCount' &gt; 0">
              <set token="TREEMAP">true</set>
            </condition>
            <condition>
              <unset token="TREEMAP">true</unset>
            </condition>
          </done>
          <done>
            <set token="SELECTED_PU">*</set>
            <set token="SELECTED_PL">*</set>
          </done>
          <query>index=*|stats count by sourcetype source</query>
          <earliest>-60m@m</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">all</option>
        <option name="link.exportResults.visible">0</option>
        <option name="link.inspectSearch.visible">0</option>
        <option name="link.openPivot.visible">0</option>
               <option name="refresh.display">progressbar</option>
        <option name="refresh.link.visible">0</option>
        <option name="treemap_app.treemap.colorMode">categorical</option>
        <option name="treemap_app.treemap.maxCategories">15</option>
        <option name="treemap_app.treemap.maxColor">#3fc77a</option>
        <option name="treemap_app.treemap.minColor">#d93f3c</option>
        <option name="treemap_app.treemap.numOfBins">9</option>
        <option name="treemap_app.treemap.showLabels">true</option>
        <option name="treemap_app.treemap.showLegend">false</option>
        <option name="treemap_app.treemap.showTooltip">true</option>
        <option name="treemap_app.treemap.useColors">true</option>
        <option name="treemap_app.treemap.useZoom">true</option>
        <drilldown>
          <set token="SELECTED_PU">$row.source$</set>
          <set token="SELECTED_PL">$row.sourcetype$</set>
        </drilldown>
      </viz>
      <html>
          <div style="color: brown;font-weight: bold;text-align: left;">[NOTE: Click HC Rule Tile To See More Details]</div>
          <center>
          
        </center>
      </html>
    </panel>
  </row>
  <row>
    <panel>
            <table>
        <title>Table</title>
        <search>
          <done>
            <condition match="$SELECTED_RULENAME$=&quot;Variables_withCalculationIntervals&quot;">
              <set token="var_TABLE">true</set>
            </condition>
            <condition>
              <unset token="var_TABLE">true</unset>
            </condition>
          </done>
          <query>index=*|stats count by sourcetype source|search sourcetype=$SELECTED_PL$ source=$SELECTED_PU$</query>
          <earliest>-60m@m</earliest>
          <latest>now</latest>
        </search>
        <option name="count">50</option>
        <option name="drilldown">none</option>
        <option name="link.exportResults.visible">1</option>
        <option name="link.inspectSearch.visible">0</option>
        <option name="link.openPivot.visible">0</option>
        <option name="link.openSearch.visible">$HAS_ADMIN_ROLE$</option>
        <option name="rowNumbers">true</option>
      </table>
    </panel>
  </row>
</form>
0 Karma
Get Updates on the Splunk Community!

Webinar Recap | Revolutionizing IT Operations: The Transformative Power of AI and ML ...

The Transformative Power of AI and ML in Enhancing Observability   In the realm of IT operations, the ...

.conf24 | Registration Open!

Hello, hello! I come bearing good news: Registration for .conf24 is now open!   conf is Splunk’s rad annual ...

ICYMI - Check out the latest releases of Splunk Edge Processor

Splunk is pleased to announce the latest enhancements to Splunk Edge Processor.  HEC Receiver authorization ...