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
Career Survey
First 500 qualified respondents will receive a $20 gift card! Tell us about your professional Splunk journey.

Can’t make it to .conf25? Join us online!

Get Updates on the Splunk Community!

Splunkbase Unveils New App Listing Management Public Preview

Splunkbase Unveils New App Listing Management Public PreviewWe're thrilled to announce the public preview of ...

Leveraging Automated Threat Analysis Across the Splunk Ecosystem

Are you leveraging automation to its fullest potential in your threat detection strategy?Our upcoming Security ...

Can’t Make It to Boston? Stream .conf25 and Learn with Haya Husain

Boston may be buzzing this September with Splunk University and .conf25, but you don’t have to pack a bag to ...