Dashboards & Visualizations

I have multi-select Drilldown inputs in XML format .The page has pie chart when u click on the value it drills down those values to a table .

chitreshakumar
Communicator

I have a multi-select Drilldown input in XML format .The page has pie chart when u click on the value it drills down those values to a table .I want to reset it everytime whenever I select the clear filter button on the page .I have written one XML code .

<input type="link" token="reset_tok" searchWhenChanged="true" depends="global_active_search">
        <label></label>
        <choice value="reset">Clear Filters</choice>
        <change>
          <set token="reset_tok">*</set>
           <unset token="form.asset_id"></unset>
           <unset token="form.ticket_type"></unset>
           <unset token="form.owner_names"></unset>
           <unset token="form.config_item"></unset>
           <unset token="form.crossapplication"></unset>
          <unset token="form.bucket_label"></unset>
          <set token="form.time.earliest">-13mon@mon</set>
          <set token="form.time.latest">@mon</set>
         </change>
      </input>

But I am able to clear or unset the token only once .What should be done if I want it to be clearing the token whenever I select??

Tags (4)
0 Karma
1 Solution

niketn
Legend

@chitreshakumar, please try the following checkbox input instead of link. Ideally you should add Reset button through HTML panel and code token unset through Simple XML JS Extension.

PS: Checking Clear Tokens resets the token and then removes the check (unsets the checkbox form token after unsetting other tokens i.e. <unset token="tokClear"></unset><unset token="form.tokClear"></unset> )

  <input type="checkbox" token="tokClear" searchWhenChanged="true">
    <label></label>
    <change>
      <condition value="reset">
        <unset token="asset_id"></unset>
        <unset token="ticket_type"></unset>
        <unset token="owner_names"></unset>
        <unset token="config_item"></unset>
        <unset token="crossapplication"></unset>
        <unset token="bucket_label"></unset>
        <unset token="reset_tok"></unset>
        <unset token="form.reset_tok"></unset>
        <set token="time.earliest">-13mon@mon</set>
        <set token="time.latest">@mon</set>
        <unset token="tokClear"></unset>
        <unset token="form.tokClear"></unset>
      </condition>
    </change>
    <choice value="reset">Clear Tokens</choice>
    <delimiter> </delimiter>
  </input>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"

View solution in original post

0 Karma

niketn
Legend

@chitreshakumar, please try the following checkbox input instead of link. Ideally you should add Reset button through HTML panel and code token unset through Simple XML JS Extension.

PS: Checking Clear Tokens resets the token and then removes the check (unsets the checkbox form token after unsetting other tokens i.e. <unset token="tokClear"></unset><unset token="form.tokClear"></unset> )

  <input type="checkbox" token="tokClear" searchWhenChanged="true">
    <label></label>
    <change>
      <condition value="reset">
        <unset token="asset_id"></unset>
        <unset token="ticket_type"></unset>
        <unset token="owner_names"></unset>
        <unset token="config_item"></unset>
        <unset token="crossapplication"></unset>
        <unset token="bucket_label"></unset>
        <unset token="reset_tok"></unset>
        <unset token="form.reset_tok"></unset>
        <set token="time.earliest">-13mon@mon</set>
        <set token="time.latest">@mon</set>
        <unset token="tokClear"></unset>
        <unset token="form.tokClear"></unset>
      </condition>
    </change>
    <choice value="reset">Clear Tokens</choice>
    <delimiter> </delimiter>
  </input>
____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

chitreshakumar
Communicator

Hello @niketn !! Thanks for answering!!
It worked after I added form to asset_id .One more thing I would like to add "I have a pie chart when I click on one of the values of pie ,it shows the values corresponding to that "These tokens are corresponding to those pie charts .

<unset token="bucket_label"></unset>

0 Karma

niketn
Legend

@chitreshakumar , sorry I was testing few things on local machine using <init> to default token, so did not have form token to reset in local 😉 Glad you were able to figure out. (Y)

Only two changes you needed were to 1) convert Link input to Checkbox and (2) unset check box value also after unsetting the remaining tokens.

____________________________________________
| makeresults | eval message= "Happy Splunking!!!"
0 Karma

chitreshakumar
Communicator

Thanks man!! It worked

0 Karma
Get Updates on the Splunk Community!

How to Monitor Google Kubernetes Engine (GKE)

We’ve looked at how to integrate Kubernetes environments with Splunk Observability Cloud, but what about ...

Index This | How can you make 45 using only 4?

October 2024 Edition Hayyy Splunk Education Enthusiasts and the Eternally Curious!  We’re back with this ...

Splunk Education Goes to Washington | Splunk GovSummit 2024

If you’re in the Washington, D.C. area, this is your opportunity to take your career and Splunk skills to the ...