<?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: Can we save output of a table in different tokens? in Splunk Dev</title>
    <link>https://community.splunk.com/t5/Splunk-Dev/Can-we-save-output-of-a-table-in-different-tokens/m-p/425383#M7566</link>
    <description>&lt;P&gt;I cannot understand what you are trying to do... Can you explain and provide more info?&lt;/P&gt;</description>
    <pubDate>Fri, 01 Jun 2018 10:51:28 GMT</pubDate>
    <dc:creator>Javip</dc:creator>
    <dc:date>2018-06-01T10:51:28Z</dc:date>
    <item>
      <title>Can we save output of a table in different tokens?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-we-save-output-of-a-table-in-different-tokens/m-p/425382#M7565</link>
      <description>&lt;P&gt;Can we save output of a table in different tokens?&lt;/P&gt;

&lt;P&gt;The output of Splunk query is a table.&lt;BR /&gt;
Can i save all results in different tokens?&lt;/P&gt;

&lt;P&gt;Example: (Output of Splunk query)&lt;BR /&gt;
Row     Count_by_values&lt;BR /&gt;
1       123&lt;BR /&gt;
2       4567&lt;BR /&gt;
3       5896&lt;BR /&gt;
4       4573&lt;BR /&gt;
5       3512&lt;/P&gt;

&lt;P&gt;Here, can i store all values(123, 4567, 5896, 4573, 3512) in 5 different tokens?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:44:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-we-save-output-of-a-table-in-different-tokens/m-p/425382#M7565</guid>
      <dc:creator>srujan0009</dc:creator>
      <dc:date>2020-09-29T19:44:35Z</dc:date>
    </item>
    <item>
      <title>Re: Can we save output of a table in different tokens?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-we-save-output-of-a-table-in-different-tokens/m-p/425383#M7566</link>
      <description>&lt;P&gt;I cannot understand what you are trying to do... Can you explain and provide more info?&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 10:51:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-we-save-output-of-a-table-in-different-tokens/m-p/425383#M7566</guid>
      <dc:creator>Javip</dc:creator>
      <dc:date>2018-06-01T10:51:28Z</dc:date>
    </item>
    <item>
      <title>Re: Can we save output of a table in different tokens?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-we-save-output-of-a-table-in-different-tokens/m-p/425384#M7567</link>
      <description>&lt;P&gt;If you could share about your actual requirement .. we can try some different solution.. because the requirement in your question is not like a good approach for any problem.solution..&lt;/P&gt;

&lt;P&gt;Now the Answer  for your question is NO,&lt;BR /&gt;&lt;BR /&gt;
Because, Using simple xml we can populate the splunk tokens  only using the fields in the last row of the  result.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 11:01:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-we-save-output-of-a-table-in-different-tokens/m-p/425384#M7567</guid>
      <dc:creator>paramagurukarth</dc:creator>
      <dc:date>2018-06-01T11:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: Can we save output of a table in different tokens?</title>
      <link>https://community.splunk.com/t5/Splunk-Dev/Can-we-save-output-of-a-table-in-different-tokens/m-p/425385#M7568</link>
      <description>&lt;P&gt;@srujan0009 there could be multiple options to do this but depending on several things like:&lt;BR /&gt;
1) What you want to do afterwards once you have the results from above table?&lt;BR /&gt;
2) Are there always five values or can the number of results differ?&lt;/P&gt;

&lt;P&gt;Please add more details for the community members to help. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Following are the three options I can think of:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;1)&lt;/STRONG&gt; Use Post Processing to reuse the search to initial further processing on existing results&lt;BR /&gt;
&lt;STRONG&gt;2)&lt;/STRONG&gt; Use the Search job Id (thorough &lt;CODE&gt;addinfo&lt;/CODE&gt; command or &lt;CODE&gt;$job.sid$&lt;/CODE&gt;built in search job token) to load the job results using &lt;CODE&gt;loadjob&lt;/CODE&gt; command and perform further actions on results&lt;BR /&gt;
&lt;STRONG&gt;3)&lt;/STRONG&gt; You can use &lt;CODE&gt;transpose&lt;/CODE&gt; command to convert rows to column and fetch the default search job token for each result in the first row using &lt;CODE&gt;&amp;lt;done&amp;gt;&lt;/CODE&gt; or &lt;CODE&gt;&amp;lt;progress&amp;gt;&lt;/CODE&gt; search event handler through &lt;CODE&gt;$result.fieldname$&lt;/CODE&gt; token.&lt;BR /&gt;
&lt;STRONG&gt;4)&lt;/STRONG&gt; If you are on 6.6. or higher Trellis can be used to break up row level data to visualizations like Single Value, Gauges etc.&lt;/P&gt;

&lt;P&gt;Following is a run anywhere example for &lt;STRONG&gt;Option 3&lt;/STRONG&gt; with &lt;CODE&gt;transpose&lt;/CODE&gt; command which assumes there are only 5 rows in all the cases:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Token for each row value&amp;lt;/label&amp;gt;
  &amp;lt;!-- Dumy Search to perform transpose on original search for table--&amp;gt;
  &amp;lt;search base="baseSearch"&amp;gt;
    &amp;lt;query&amp;gt;|  transpose 5 header_field=Row
|  rename "*" as "Field_*"
    &amp;lt;/query&amp;gt;
    &amp;lt;done&amp;gt;
      &amp;lt;set token="tokField1"&amp;gt;$result.Field_1$&amp;lt;/set&amp;gt;
      &amp;lt;set token="tokField2"&amp;gt;$result.Field_2$&amp;lt;/set&amp;gt;
      &amp;lt;set token="tokField3"&amp;gt;$result.Field_3$&amp;lt;/set&amp;gt;
      &amp;lt;set token="tokField4"&amp;gt;$result.Field_4$&amp;lt;/set&amp;gt;
      &amp;lt;set token="tokField5"&amp;gt;$result.Field_5$&amp;lt;/set&amp;gt;
    &amp;lt;/done&amp;gt;
  &amp;lt;/search&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search id="baseSearch"&amp;gt;
          &amp;lt;query&amp;gt;|  makeresults
|  fields - _time
|  eval data="1 123;2 4567;3 5896;4 4573;5 3512"
|  makemv data delim=";"
|  mvexpand data
|  makemv data delim=" "
|  eval Row=mvindex(data,0), Count_by_values=mvindex(data,1)
|  fields - data, _*
|  table Row Count_by_values&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-24h@h&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;20&amp;lt;/option&amp;gt;
        &amp;lt;option name="dataOverlayMode"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="percentagesRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="rowNumbers"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="totalsRow"&amp;gt;false&amp;lt;/option&amp;gt;
        &amp;lt;option name="wrap"&amp;gt;true&amp;lt;/option&amp;gt;
      &amp;lt;/table&amp;gt;
    &amp;lt;/panel&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;div&amp;gt;
          &amp;lt;ul&amp;gt;
            &amp;lt;li&amp;gt;tokField1: $tokField1$&amp;lt;/li&amp;gt;
            &amp;lt;li&amp;gt;tokField2: $tokField2$&amp;lt;/li&amp;gt;
            &amp;lt;li&amp;gt;tokField3: $tokField3$&amp;lt;/li&amp;gt;
            &amp;lt;li&amp;gt;tokField4: $tokField4$&amp;lt;/li&amp;gt;
            &amp;lt;li&amp;gt;tokField5: $tokField5$&amp;lt;/li&amp;gt;
          &amp;lt;/ul&amp;gt;
        &amp;lt;/div&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
&amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jun 2018 13:22:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Dev/Can-we-save-output-of-a-table-in-different-tokens/m-p/425385#M7568</guid>
      <dc:creator>niketn</dc:creator>
      <dc:date>2018-06-01T13:22:06Z</dc:date>
    </item>
  </channel>
</rss>

