Splunk Search

How do I set a token to an html search string

jeradb
Explorer
<row>
    <panel depends="$tok_tab_1$">
      <table>
        <title>Alerts Fired</title>
        <search>
          <query> index=_audit action=alert_fired 
| rename ss_name AS Alert 
| stats latest(_time) AS "Event_Time"  sparkline AS "Alerts Per Day" count AS "Times Fired"
first(sid) AS sid by Alert 
| eval Event_Time=strftime(Event_Time,"%m/%d/%y %I:%M:%S %P")
| rename Event_Time AS "Last Fired"
| sort -"Times Fired"
</query>
          <earliest>$time.earliest$</earliest>
          <latest>$time.latest$</latest>
        </search>
        <fields>Alert, "Last Fired", "Times Fired", "Alerts Per Day"</fields>
        <option name="count">10</option>
        <option name="dataOverlayMode">heatmap</option>
        <option name="drilldown">cell</option>
        <option name="rowNumbers">false</option>
        <option name="wrap">true</option>
        <drilldown>
          <set token="sid">$row.sid$</set>
          <unset token="tok_tab_1"></unset>
          <set token="tok_tab_2">active</set>
          <set token="tok_display_dd"></set>
          <set token="Alert">$row.Alert$</set>
           <link target="_blank">search?sid=$row.sid$</link>
        </drilldown>
      </table>
    </panel>
  </row>
  <row>
    <panel depends="$tok_tab_2$">
      <table>
        <title>$Alert$</title>
        <search>
          <query>| search?sid=$sid$</query>
          <earliest>$earliest$</earliest>
          <latest>$latest$</latest>
        </search>
        <option name="drilldown">none</option>
        <option name="refresh.display">progressbar</option>
      </table>
    </panel>
  </row>

 

 

In the code above the below line works correctly opening a new search tab with the Alert search query.

<link target="_blank">search?sid=$row.sid$</link>

I would like to know how to have this same functionality, but within a token so I can keep it on the same page within another table.

 

 

Labels (2)
0 Karma
1 Solution

ITWhisperer
SplunkTrust
SplunkTrust

Try 

<query>| loadjob $sid$</query>

View solution in original post

ITWhisperer
SplunkTrust
SplunkTrust

Try 

<query>| loadjob $sid$</query>
Get Updates on the Splunk Community!

Fueling your curiosity with new Splunk ILT and eLearning courses

At Splunk Education, we’re driven by curiosity—both ours and yours! That’s why we’re committed to delivering ...

Splunk AI Assistant for SPL 1.1.0 | Now Personalized to Your Environment for Greater ...

Splunk AI Assistant for SPL has transformed how users interact with Splunk, making it easier than ever to ...

Unleash Unified Security and Observability with Splunk Cloud Platform

     Now Available on Microsoft AzureOn Demand Now Step boldly into the AI revolution with enhanced security ...