<?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 Using a field value twice while building a multi-select input token in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-a-field-value-twice-while-building-a-multi-select-input/m-p/686070#M56167</link>
    <description>&lt;P&gt;I have a multi-select like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    &amp;lt;input token="name" type="multiselect"&amp;gt;
      &amp;lt;label&amp;gt;Name&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;ALL&amp;lt;/choice&amp;gt;
      &amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
      &amp;lt;valuePrefix&amp;gt;name="&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;valueSuffix&amp;gt;"&amp;lt;/valueSuffix&amp;gt;
      &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;name&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;name&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;index=my_index | dedup name | sort name&amp;lt;/query&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It correctly produces a token $name$ with value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(name="VALUE1" OR name="VALUE2" ... )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I have a need to make the token look like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(name="VALUE1" OR name="VALUE1.*" OR name="VALUE2" OR name="VALUE2.*" ... )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;because if "VALUE1" is selected in the multi-select, I want events that match both "VALUE1" and "VALUE1.*" (note the dot star, not just star).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I cannot just match "VALUE1*" as that will bring in events that have a different value which BEGINS with "VALUE1" which I don't want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the question is - how can I utilize the values TWICE in the token generation? I can't wrap my head around how I might be able to achieve this.&lt;/P&gt;</description>
    <pubDate>Wed, 01 May 2024 14:53:44 GMT</pubDate>
    <dc:creator>shikhanshua</dc:creator>
    <dc:date>2024-05-01T14:53:44Z</dc:date>
    <item>
      <title>Using a field value twice while building a multi-select input token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-a-field-value-twice-while-building-a-multi-select-input/m-p/686070#M56167</link>
      <description>&lt;P&gt;I have a multi-select like this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;    &amp;lt;input token="name" type="multiselect"&amp;gt;
      &amp;lt;label&amp;gt;Name&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;ALL&amp;lt;/choice&amp;gt;
      &amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
      &amp;lt;valuePrefix&amp;gt;name="&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;valueSuffix&amp;gt;"&amp;lt;/valueSuffix&amp;gt;
      &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;name&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;name&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;index=my_index | dedup name | sort name&amp;lt;/query&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It correctly produces a token $name$ with value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(name="VALUE1" OR name="VALUE2" ... )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I have a need to make the token look like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(name="VALUE1" OR name="VALUE1.*" OR name="VALUE2" OR name="VALUE2.*" ... )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;because if "VALUE1" is selected in the multi-select, I want events that match both "VALUE1" and "VALUE1.*" (note the dot star, not just star).&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But I cannot just match "VALUE1*" as that will bring in events that have a different value which BEGINS with "VALUE1" which I don't want.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;So the question is - how can I utilize the values TWICE in the token generation? I can't wrap my head around how I might be able to achieve this.&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 14:53:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Using-a-field-value-twice-while-building-a-multi-select-input/m-p/686070#M56167</guid>
      <dc:creator>shikhanshua</dc:creator>
      <dc:date>2024-05-01T14:53:44Z</dc:date>
    </item>
    <item>
      <title>Re: Using a field value twice while building a multi-select input token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-a-field-value-twice-while-building-a-multi-select-input/m-p/686091#M56169</link>
      <description>&lt;P&gt;This should produce an equivalent token value:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;input token="name" type="multiselect"&amp;gt;
&amp;lt;label&amp;gt;Name&amp;lt;/label&amp;gt;
&amp;lt;choice value="*"&amp;gt;ALL&amp;lt;/choice&amp;gt;
&amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
&amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
&amp;lt;valuePrefix&amp;gt;name IN ("&amp;lt;/valuePrefix&amp;gt;
&amp;lt;valueSuffix&amp;gt;")&amp;lt;/valueSuffix&amp;gt;
&amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
&amp;lt;fieldForLabel&amp;gt;name&amp;lt;/fieldForLabel&amp;gt;
&amp;lt;fieldForValue&amp;gt;val&amp;lt;/fieldForValue&amp;gt;
&amp;lt;search&amp;gt;
&amp;lt;query&amp;gt;index=my_index | dedup name | sort name
| eval val = name+"\",\""+name+".*"&amp;lt;/query&amp;gt;
&amp;lt;/search&amp;gt;
&amp;lt;/input&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;This will produce token values like:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(name IN ("VALUE1","VALUE1.*") OR name IN ("VALUE2","VALUE2.*") ...)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Which are equivalent to&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;(name="VALUE1" OR name="VALUE1.*" OR name="VALUE2" OR name="VALUE2.*" ... )&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;EDIT:&amp;nbsp;&lt;/P&gt;&lt;P&gt;Now that I think about it, you can make exactly that token value by doing this:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;input token="name" type="multiselect"&amp;gt;
      &amp;lt;label&amp;gt;Name&amp;lt;/label&amp;gt;
      &amp;lt;choice value="*"&amp;gt;ALL&amp;lt;/choice&amp;gt;
      &amp;lt;prefix&amp;gt;(&amp;lt;/prefix&amp;gt;
      &amp;lt;suffix&amp;gt;)&amp;lt;/suffix&amp;gt;
      &amp;lt;valuePrefix&amp;gt;&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;valueSuffix&amp;gt;&amp;lt;/valueSuffix&amp;gt;
      &amp;lt;delimiter&amp;gt; OR &amp;lt;/delimiter&amp;gt;
      &amp;lt;fieldForLabel&amp;gt;name&amp;lt;/fieldForLabel&amp;gt;
      &amp;lt;fieldForValue&amp;gt;val&amp;lt;/fieldForValue&amp;gt;
      &amp;lt;search&amp;gt;
        &amp;lt;query&amp;gt;index=my_index | dedup name | sort name
| eval val = "name=\""+name+"\" OR name=\""+name+".*\""&amp;lt;/query&amp;gt;
      &amp;lt;/search&amp;gt;
    &amp;lt;/input&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 17:56:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Using-a-field-value-twice-while-building-a-multi-select-input/m-p/686091#M56169</guid>
      <dc:creator>marnall</dc:creator>
      <dc:date>2024-05-01T17:56:16Z</dc:date>
    </item>
    <item>
      <title>Re: Using a field value twice while building a multi-select input token</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Using-a-field-value-twice-while-building-a-multi-select-input/m-p/686109#M56170</link>
      <description>&lt;P&gt;Genius! Works perfectly!&lt;/P&gt;</description>
      <pubDate>Wed, 01 May 2024 17:29:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Using-a-field-value-twice-while-building-a-multi-select-input/m-p/686109#M56170</guid>
      <dc:creator>shikhanshua</dc:creator>
      <dc:date>2024-05-01T17:29:34Z</dc:date>
    </item>
  </channel>
</rss>

