<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Re: How to set token from specific row &amp; field in a table? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421762#M27787</link>
    <description>&lt;P&gt;Ok.... as far as I know, you can't set tokens from specific row number in the table. What you can do is create another search which is not used in any visualization but is using base="bigoldquery" and running your appendpipe stats are regular stats. The purpose of this search will be just to set tokens.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search id="bigolsummtok" base="bigoldquery"&amp;gt;
     &amp;lt;query&amp;gt; 
         |  stats sum(fld1) as fld1 sum(fld2) as fld2 
         | eval fldavg=round(fld1/fld2*100,1)
     &amp;lt;/query&amp;gt;
     &amp;lt;done&amp;gt;
         &amp;lt;set token="fld1val"&amp;gt;$result.fld1$&amp;lt;/set&amp;gt;
         &amp;lt;set token="fld2val"&amp;gt;$result.fld2$&amp;lt;/set&amp;gt;
         &amp;lt;set token="fldavgval"&amp;gt;$result.fldavg$&amp;lt;/set&amp;gt;
     &amp;lt;/done&amp;gt;
 &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Mon, 22 Apr 2019 19:06:00 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2019-04-22T19:06:00Z</dc:date>
    <item>
      <title>How to set token from specific row &amp; field in a table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421759#M27784</link>
      <description>&lt;P&gt;Ok, so I'm trying to consolidate some searches and one sticking point is that I've got an ugly base search chased by another doing an appendpipe to give me a summary row.  Ideally I'd like it to be one search, however, I need to set tokens from the values in the summary but cannot seem to make that happen outside of the separate search.&lt;BR /&gt;
I know it uses the $result.fieldname$ method and drilldowns use  $row.column$.  I'm kinda hoping there's a hybrid to specify the row# or last row specifically using the $result.xxx$ style.  (If there is, I can 't get the syntax correct...)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search id="bigolquery"&amp;gt;
    &amp;lt;query&amp;gt; yadda yadda &amp;lt;/query&amp;gt;
&amp;lt;/search&amp;gt;
&amp;lt;search id="bigolsumm" base="bigoldquery"&amp;gt;
    &amp;lt;query&amp;gt; 
        | appendpipe [ stats sum(fld1) as fld1 sum(fld2) as fld2 
        | eval fldavg=round(fld1/fld2*100,1)]
    &amp;lt;/query&amp;gt;
    &amp;lt;done&amp;gt;
        &amp;lt;set token="fld1val"&amp;gt;$result.fld1$&amp;lt;/set&amp;gt;
        &amp;lt;set token="fld2val"&amp;gt;$result.fld2$&amp;lt;/set&amp;gt;
        &amp;lt;set token="fldavgval"&amp;gt;$result.fldavg$&amp;lt;/set&amp;gt;
    &amp;lt;/done&amp;gt;
&amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Apr 2019 18:26:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421759#M27784</guid>
      <dc:creator>htrednek</dc:creator>
      <dc:date>2019-04-22T18:26:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to set token from specific row &amp; field in a table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421760#M27785</link>
      <description>&lt;P&gt;Are you using bigolsumm query in any visualization Or it's just for setting the token?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2019 18:39:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421760#M27785</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-04-22T18:39:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to set token from specific row &amp; field in a table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421761#M27786</link>
      <description>&lt;P&gt;yes.  It's displayed as part of the table as well as setting the tokens.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2019 18:52:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421761#M27786</guid>
      <dc:creator>htrednek</dc:creator>
      <dc:date>2019-04-22T18:52:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to set token from specific row &amp; field in a table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421762#M27787</link>
      <description>&lt;P&gt;Ok.... as far as I know, you can't set tokens from specific row number in the table. What you can do is create another search which is not used in any visualization but is using base="bigoldquery" and running your appendpipe stats are regular stats. The purpose of this search will be just to set tokens.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;search id="bigolsummtok" base="bigoldquery"&amp;gt;
     &amp;lt;query&amp;gt; 
         |  stats sum(fld1) as fld1 sum(fld2) as fld2 
         | eval fldavg=round(fld1/fld2*100,1)
     &amp;lt;/query&amp;gt;
     &amp;lt;done&amp;gt;
         &amp;lt;set token="fld1val"&amp;gt;$result.fld1$&amp;lt;/set&amp;gt;
         &amp;lt;set token="fld2val"&amp;gt;$result.fld2$&amp;lt;/set&amp;gt;
         &amp;lt;set token="fldavgval"&amp;gt;$result.fldavg$&amp;lt;/set&amp;gt;
     &amp;lt;/done&amp;gt;
 &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 22 Apr 2019 19:06:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421762#M27787</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2019-04-22T19:06:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to set token from specific row &amp; field in a table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421763#M27788</link>
      <description>&lt;P&gt;@htrednek the default token &lt;CODE&gt;$result.&amp;lt;fieldname&amp;gt;$&lt;/CODE&gt; fetches the first row of result. So crooked way would be you use &lt;CODE&gt;| reverse&lt;/CODE&gt; in your subsearch and your last row will become first row. Hence the &lt;CODE&gt;$result.&amp;lt;fieldname&amp;gt;$&lt;/CODE&gt; token will access the value from the last row.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Apr 2019 19:18:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421763#M27788</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2019-04-22T19:18:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to set token from specific row &amp; field in a table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421764#M27789</link>
      <description>&lt;P&gt;Add this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | eventstats last(xxx) AS _last_xxx
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then &lt;EM&gt;every&lt;/EM&gt; row has an invisible field called &lt;CODE&gt;_last_xxx&lt;/CODE&gt; with the last value of &lt;CODE&gt;xxx&lt;/CODE&gt; so you can then use &lt;CODE&gt;$result._last_xxx$&lt;/CODE&gt;.&lt;/P&gt;</description>
      <pubDate>Tue, 23 Apr 2019 03:17:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421764#M27789</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2019-04-23T03:17:53Z</dc:date>
    </item>
    <item>
      <title>Re: How to set token from specific row &amp; field in a table?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421765#M27790</link>
      <description>&lt;P&gt;This works perfectly.  Thank you!&lt;/P&gt;</description>
      <pubDate>Wed, 24 Apr 2019 16:45:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-set-token-from-specific-row-field-in-a-table/m-p/421765#M27790</guid>
      <dc:creator>htrednek</dc:creator>
      <dc:date>2019-04-24T16:45:07Z</dc:date>
    </item>
  </channel>
</rss>

