Splunk Search

Resetting a token using a <html> button

robertlynch2020
Influencer

Hi

I am trying to re-set a text box when a button is pressed. However as it using a  <html> button, i just dont know where to start. Any ideas ? Thanks in advance

robertlynch2020_0-1636031090580.png

 

 

 

    <panel depends="$host_token$,$functional_validation_token$" id="comment" rejects="$showExpandLink5$">
      <title>Update Comments for $script_token$</title>
      <input type="text" token="comment_token" searchWhenChanged="true">
        <label>Comment</label>
        <default>*</default>
        <initialValue>*</initialValue>
      </input>
      <html>
                 <style>.btn-primary { margin: 5px 10px 5px 0; }</style>
                 <a href="http://$mte_machine$:4444/executeScript/envMonitoring@@qcst_processingScriptsChecks.sh/-updateComment/$runid_token$/$script_token$/$npid_token$/%22$comment_token$%22" target="_blank" class="btn btn-primary" style="height:25px;width:250px;">Submit</a>
             </html>
    </panel>

 

 

 

0 Karma

somesoni2
Revered Legend
0 Karma

robertlynch2020
Influencer

I think I have applied this correctly - but it does want to work....hmmm.

I need it to go to a new link and to reset the token

 

  <panel depends="$host_token$,$functional_validation_token$" id="comment" rejects="$showExpandLink5$">
      <title>Update Comments for $script_token$</title>
      <input type="text" token="comment_token"  searchWhenChanged="true">
        <label>Comment</label>
        <default>*</default>
        <initialValue>*</initialValue>
      </input>
      <html>
                 <style>.btn-primary { margin: 5px 10px 5px 0; }</style>
                 <a href="http://$mte_machine$:4444/executeScript/envMonitoring@@qcst_processingScriptsChecks.sh/-updateComment/$runid_token$/$script_token$/$npid_token$/%22$comment_token$%22" target="_blank" class="btn btn-primary" id="buttonId" style="height:25px;width:250px;">Submit</a>
             </html>
    </panel>

 

 

 

require([
        'jquery',
        'splunkjs/mvc',
        'splunkjs/mvc/simplexml/ready!'
    ], function ($, mvc) {
    var tokens = mvc.Components.get("default");
    $('#buttonId').on("click", function (e){
        tokens.set("form.comment_token", "*");
    });
});

 

 

Tags (1)
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!

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

Splunk Lantern’s Guide to The Most Popular .conf25 Sessions

Splunk Lantern is a Splunk customer success center that provides advice from Splunk experts on valuable data ...