<?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 pass multiple values for a field through token in a dashboard? in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiple-values-for-a-field-through-token-in-a/m-p/354654#M23140</link>
    <description>&lt;P&gt;Thanks for a great hint about &lt;CODE&gt;&amp;lt;eval&amp;gt;&lt;/CODE&gt; for token modification, it helped me to modify a token in drilldown to get the first value of multivalue token:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;drilldown&amp;gt;
  &amp;lt;eval token="tok1"&amp;gt;mvindex($row.multivalue_field$, 0)&amp;lt;/eval&amp;gt;
  &amp;lt;set token="form.INPUT_TOKEN"&amp;gt;$tok1$&amp;lt;/set&amp;gt;
&amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 28 Feb 2018 05:02:04 GMT</pubDate>
    <dc:creator>fpavlovi</dc:creator>
    <dc:date>2018-02-28T05:02:04Z</dc:date>
    <item>
      <title>How to pass multiple values for a field through token in a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiple-values-for-a-field-through-token-in-a/m-p/354652#M23138</link>
      <description>&lt;P&gt;Ex - &lt;/P&gt;

&lt;P&gt;Suppose i want to check results for 10 servers. So in dashboard I should be able to enter 10 values in token &lt;/P&gt;

&lt;P&gt;like server1,server2,server3,server4...&lt;/P&gt;</description>
      <pubDate>Fri, 28 Apr 2017 15:59:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiple-values-for-a-field-through-token-in-a/m-p/354652#M23138</guid>
      <dc:creator>nasamajh09</dc:creator>
      <dc:date>2017-04-28T15:59:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple values for a field through token in a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiple-values-for-a-field-through-token-in-a/m-p/354653#M23139</link>
      <description>&lt;P&gt;You can (for 6.3 or higher version of splunk) use &lt;CODE&gt;&amp;lt;eval&amp;gt;&lt;/CODE&gt; in your form input to update the token value to be format which can be used in the search directly.&lt;/P&gt;

&lt;P&gt;E.g. Say you want to token value $hosts$ to be used against field host in your search, try like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;input type="dropdown" token="hosts"&amp;gt;
      &amp;lt;label&amp;gt;Enter hosts&amp;lt;/label&amp;gt;
      &amp;lt;default&amp;gt;*&amp;lt;/default&amp;gt;
  &amp;lt;change&amp;gt;
      &amp;lt;eval token="host_tok"&amp;gt;"host=".replace("$hosts$",","," OR host=")&amp;lt;/eval&amp;gt;
     &amp;lt;/change&amp;gt;
    &amp;lt;/input&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You'll be using $host_tok$ in your search e.g. &lt;CODE&gt;index=foo sourcetype=bar $host_tok$&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;Other option would be to handle the splitting/formatting in the search itself, like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=foo sourcetype=bar [| gentimes start=-1 | eval host="$hosts$" | makemv host delim="," | mvexpand host | table host]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 29 Sep 2020 13:52:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiple-values-for-a-field-through-token-in-a/m-p/354653#M23139</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-09-29T13:52:47Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple values for a field through token in a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiple-values-for-a-field-through-token-in-a/m-p/354654#M23140</link>
      <description>&lt;P&gt;Thanks for a great hint about &lt;CODE&gt;&amp;lt;eval&amp;gt;&lt;/CODE&gt; for token modification, it helped me to modify a token in drilldown to get the first value of multivalue token:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;drilldown&amp;gt;
  &amp;lt;eval token="tok1"&amp;gt;mvindex($row.multivalue_field$, 0)&amp;lt;/eval&amp;gt;
  &amp;lt;set token="form.INPUT_TOKEN"&amp;gt;$tok1$&amp;lt;/set&amp;gt;
&amp;lt;/drilldown&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 28 Feb 2018 05:02:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiple-values-for-a-field-through-token-in-a/m-p/354654#M23140</guid>
      <dc:creator>fpavlovi</dc:creator>
      <dc:date>2018-02-28T05:02:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to pass multiple values for a field through token in a dashboard?</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiple-values-for-a-field-through-token-in-a/m-p/354655#M23141</link>
      <description>&lt;P&gt;Sorry to dig this up from the past, but I used your advice here and it worked great (specifically the in search version) however, I have a question.  My scenario is that I have a dashboard set up to search data based on Userid. We wanted to be able to enter multiple userids into a text box to search. This worked for us, however, say I have 6 users A, B, C, D, E, F and I enter A,B,C in to my search, I get everything for A B and C, but also 1 or two events for D and F, even though I didn't say anything in my query about D or F.  Any idea why I'd be getting extra events in my results? &lt;/P&gt;</description>
      <pubDate>Thu, 13 Dec 2018 15:13:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/How-to-pass-multiple-values-for-a-field-through-token-in-a/m-p/354655#M23141</guid>
      <dc:creator>newill</dc:creator>
      <dc:date>2018-12-13T15:13:35Z</dc:date>
    </item>
  </channel>
</rss>

