<?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 do you store search results in a token or variable? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424751#M27979</link>
    <description>&lt;P&gt;So you have a table with one field/column and multiple rows, correct?&lt;/P&gt;

&lt;P&gt;Tokens are used for single values/numbers, so this is going to get tricky.&lt;/P&gt;

&lt;P&gt;You could do something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_* | stats list(sourcetype) as sourcetypes | eval sourcetypes=mvjoin(sourcetypes, ",")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will put all values in a single string which can be saved in a token.&lt;/P&gt;

&lt;P&gt;Alternatively, Splunk dashboards have a whole lot of JavaScript and CSS capabilities which might help you better.&lt;/P&gt;</description>
    <pubDate>Fri, 07 Dec 2018 07:46:39 GMT</pubDate>
    <dc:creator>whrg</dc:creator>
    <dc:date>2018-12-07T07:46:39Z</dc:date>
    <item>
      <title>How do you store search results in a token or variable?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424746#M27974</link>
      <description>&lt;P&gt;I want to run a search as an inputlookup after a field (name of the Field: "Field-1"). In the next step, I want to save the result of this search and display it in an HTML block.&lt;/P&gt;

&lt;P&gt;How can I do this?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 09:41:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424746#M27974</guid>
      <dc:creator>yasin_tk</dc:creator>
      <dc:date>2018-12-06T09:41:21Z</dc:date>
    </item>
    <item>
      <title>Re: How do you store search results in a token or variable?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424747#M27975</link>
      <description>&lt;P&gt;Hey,&lt;/P&gt;

&lt;P&gt;you can use &lt;CODE&gt;outputlookup&lt;/CODE&gt; and use the result of this to show it in a dashboard.&lt;/P&gt;

&lt;P&gt;Does this fit your need?&lt;/P&gt;

&lt;P&gt;All the best,&lt;BR /&gt;
Björn&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 12:09:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424747#M27975</guid>
      <dc:creator>bjoernjensen</dc:creator>
      <dc:date>2018-12-06T12:09:28Z</dc:date>
    </item>
    <item>
      <title>Re: How do you store search results in a token or variable?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424748#M27976</link>
      <description>&lt;P&gt;I want to display with a inputlookup search a field from the inputlookup in my dashboard between the html tags?&lt;/P&gt;

&lt;P&gt;Is this possible?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 13:46:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424748#M27976</guid>
      <dc:creator>yasin_tk</dc:creator>
      <dc:date>2018-12-06T13:46:32Z</dc:date>
    </item>
    <item>
      <title>Re: How do you store search results in a token or variable?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424749#M27977</link>
      <description>&lt;P&gt;Hi!&lt;BR /&gt;
First, I recommend you learn how to use tokens in dashboards: &lt;A href="http://docs.splunk.com/Documentation/Splunk/7.2.1/Viz/tokens"&gt;Token usage in dashboards&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;You should add a &lt;EM&gt;done&lt;/EM&gt; section to your &lt;EM&gt;inputlookup&lt;/EM&gt; search to set the result as a token.&lt;/P&gt;

&lt;P&gt;Then in your html block you can reference this token.&lt;/P&gt;

&lt;P&gt;Kind of like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;dashboard&amp;gt;
  &amp;lt;label&amp;gt;Test&amp;lt;/label&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;html&amp;gt;
        &amp;lt;center&amp;gt;
          &amp;lt;h1&amp;gt;Title: $mytoken$&amp;lt;/h1&amp;gt;
        &amp;lt;/center&amp;gt;
      &amp;lt;/html&amp;gt;
    &amp;lt;/panel&amp;gt;
  &amp;lt;/row&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;table&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index=_* | head 1 | table sourcetype&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-60m@m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;done&amp;gt;
            &amp;lt;set token="mytoken"&amp;gt;$result.sourcetype$&amp;lt;/set&amp;gt;
          &amp;lt;/done&amp;gt;
         &amp;lt;/search&amp;gt;
        &amp;lt;option name="count"&amp;gt;10&amp;lt;/option&amp;gt;
        &amp;lt;option name="drilldown"&amp;gt;none&amp;lt;/option&amp;gt;
        &amp;lt;option name="refresh.display"&amp;gt;progressbar&amp;lt;/option&amp;gt;
      &amp;lt;/table&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>Thu, 06 Dec 2018 14:48:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424749#M27977</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2018-12-06T14:48:45Z</dc:date>
    </item>
    <item>
      <title>Re: How do you store search results in a token or variable?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424750#M27978</link>
      <description>&lt;P&gt;This is very useful. Thanks a lot. But I have another question in this case.&lt;/P&gt;

&lt;P&gt;With this part:&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;PRE&gt;&lt;CODE&gt;       &amp;lt;query&amp;gt;index=_* | head 1 | table sourcetype&amp;lt;/query&amp;gt;
       &amp;lt;earliest&amp;gt;-60m@m&amp;lt;/earliest&amp;gt;
       &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
       &amp;lt;done&amp;gt;
         &amp;lt;set token="mytoken"&amp;gt;$result.sourcetype$&amp;lt;/set&amp;gt;
       &amp;lt;/done&amp;gt;
      &amp;lt;/search&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;I can see on this place: &lt;/P&gt;

&lt;BLOCKQUOTE&gt;
&lt;H1&gt;Title: $mytoken$&lt;/H1&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;Only one entry, but my table has in this field many other values/results. How can I display all values of the hole fields?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2018 15:54:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424750#M27978</guid>
      <dc:creator>yasin_tk</dc:creator>
      <dc:date>2018-12-06T15:54:44Z</dc:date>
    </item>
    <item>
      <title>Re: How do you store search results in a token or variable?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424751#M27979</link>
      <description>&lt;P&gt;So you have a table with one field/column and multiple rows, correct?&lt;/P&gt;

&lt;P&gt;Tokens are used for single values/numbers, so this is going to get tricky.&lt;/P&gt;

&lt;P&gt;You could do something like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=_* | stats list(sourcetype) as sourcetypes | eval sourcetypes=mvjoin(sourcetypes, ",")
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This will put all values in a single string which can be saved in a token.&lt;/P&gt;

&lt;P&gt;Alternatively, Splunk dashboards have a whole lot of JavaScript and CSS capabilities which might help you better.&lt;/P&gt;</description>
      <pubDate>Fri, 07 Dec 2018 07:46:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424751#M27979</guid>
      <dc:creator>whrg</dc:creator>
      <dc:date>2018-12-07T07:46:39Z</dc:date>
    </item>
    <item>
      <title>Re: How do you store search results in a token or variable?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424752#M27980</link>
      <description>&lt;P&gt;why do you only give half answers? or make it harder than it needs to be? &lt;/P&gt;

&lt;P&gt;"you can use outputlookup and use the result of this to show it in a dashboard.&lt;/P&gt;

&lt;P&gt;Does this fit your need?   OK how ?&lt;/P&gt;</description>
      <pubDate>Mon, 28 Oct 2019 01:20:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-do-you-store-search-results-in-a-token-or-variable/m-p/424752#M27980</guid>
      <dc:creator>onegame999</dc:creator>
      <dc:date>2019-10-28T01:20:35Z</dc:date>
    </item>
  </channel>
</rss>

