Splunk Search

How do I get data from a stats table to send as a token?

jadengoho
Builder

Hi ,
I have a table with a single data value inside.

  |makeresults 
   |eval value=1

I just want to get the value "1" and send as a token after the table completely finish.

Currently, i can get the data but only when i click the field.

Thanks in advance

Tags (2)
0 Karma
1 Solution

renjith_nair
Legend

@jadengoho ,
You can add a event based token on the completion of search of table by using done.
E.g.

<dashboard>
  <label>Auto Load Of Token</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults | eval value=1</query>
          <earliest>-1s@s</earliest>
          <latest>now</latest>
          <done>
            <set token="value_token">$result.value$</set>
          </done>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
  <row>
    <panel>
      <single>
        <search>
          <query>|makeresults|eval mytoken=$value_token$</query>
          <earliest>-1s@s</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </single>
    </panel>
  </row>
</dashboard>
Happy Splunking!

View solution in original post

0 Karma

renjith_nair
Legend

@jadengoho ,
You can add a event based token on the completion of search of table by using done.
E.g.

<dashboard>
  <label>Auto Load Of Token</label>
  <row>
    <panel>
      <table>
        <search>
          <query>| makeresults | eval value=1</query>
          <earliest>-1s@s</earliest>
          <latest>now</latest>
          <done>
            <set token="value_token">$result.value$</set>
          </done>
        </search>
        <option name="drilldown">none</option>
      </table>
    </panel>
  </row>
  <row>
    <panel>
      <single>
        <search>
          <query>|makeresults|eval mytoken=$value_token$</query>
          <earliest>-1s@s</earliest>
          <latest>now</latest>
        </search>
        <option name="drilldown">none</option>
      </single>
    </panel>
  </row>
</dashboard>
Happy Splunking!
0 Karma

overratedkungmi
New Member
0 Karma
Get Updates on the Splunk Community!

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

Introducing the 2024 SplunkTrust!

Hello, Splunk Community! We are beyond thrilled to announce our newest group of SplunkTrust members!  The ...