<?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: using multiselect to concatenate fields into a compound key in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/using-multiselect-to-concatenate-fields-into-a-compound-key/m-p/366957#M108240</link>
    <description>&lt;P&gt;@mschellhouse , can you try this please:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="multiselect" token="field1"&amp;gt;
      &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
      &amp;lt;choice value="Host"&amp;gt;Host&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Environment"&amp;gt;Environment&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Node Group"&amp;gt;Node Group&amp;lt;/choice&amp;gt;
      &amp;lt;delimiter&amp;gt;:&amp;lt;/delimiter&amp;gt;
      &amp;lt;valuePrefix&amp;gt;'&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;valueSuffix&amp;gt;'&amp;lt;/valueSuffix&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 27 Apr 2018 20:27:19 GMT</pubDate>
    <dc:creator>TISKAR</dc:creator>
    <dc:date>2018-04-27T20:27:19Z</dc:date>
    <item>
      <title>using multiselect to concatenate fields into a compound key</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-multiselect-to-concatenate-fields-into-a-compound-key/m-p/366955#M108238</link>
      <description>&lt;P&gt;We have a dashboard where the user can select multiple in a multiselect input field.  Those values correspond to column in a splunk table.  We want to be able to concatenate those columns, based on selection, so that we can easily chart the timeseries. We are struggling to get the dynamic list resolved in SPL to concatenate the fields.&lt;/P&gt;

&lt;P&gt;multiselect options - &lt;BR /&gt;
Host&lt;BR /&gt;
Environment&lt;BR /&gt;
Node Group&lt;BR /&gt;
etc...&lt;/P&gt;

&lt;P&gt;If we select all three, we want to create a new field in each row of the data that contains the 'Host':'Environment':'Node Group'. Sort of like creating a compound key for that summary row.  The next user might select 'Node Group':'Environment'.  Any suggestions?&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 18:57:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-multiselect-to-concatenate-fields-into-a-compound-key/m-p/366955#M108238</guid>
      <dc:creator>mschellhouse</dc:creator>
      <dc:date>2018-04-27T18:57:35Z</dc:date>
    </item>
    <item>
      <title>Re: using multiselect to concatenate fields into a compound key</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-multiselect-to-concatenate-fields-into-a-compound-key/m-p/366956#M108239</link>
      <description>&lt;P&gt;if you use a regex, you might be able to do something. The regex below is saying that the input itself is &lt;STRONG&gt;input=Environment OR input=....&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;|makeresults|eval input="$token$"|rex field=input mode=sed "s/ OR input=/':'/g"|rex field=input mode=sed "s/input=|$/'/g"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 27 Apr 2018 20:13:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-multiselect-to-concatenate-fields-into-a-compound-key/m-p/366956#M108239</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2018-04-27T20:13:07Z</dc:date>
    </item>
    <item>
      <title>Re: using multiselect to concatenate fields into a compound key</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-multiselect-to-concatenate-fields-into-a-compound-key/m-p/366957#M108240</link>
      <description>&lt;P&gt;@mschellhouse , can you try this please:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="multiselect" token="field1"&amp;gt;
      &amp;lt;label&amp;gt;field1&amp;lt;/label&amp;gt;
      &amp;lt;choice value="Host"&amp;gt;Host&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Environment"&amp;gt;Environment&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="Node Group"&amp;gt;Node Group&amp;lt;/choice&amp;gt;
      &amp;lt;delimiter&amp;gt;:&amp;lt;/delimiter&amp;gt;
      &amp;lt;valuePrefix&amp;gt;'&amp;lt;/valuePrefix&amp;gt;
      &amp;lt;valueSuffix&amp;gt;'&amp;lt;/valueSuffix&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 27 Apr 2018 20:27:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-multiselect-to-concatenate-fields-into-a-compound-key/m-p/366957#M108240</guid>
      <dc:creator>TISKAR</dc:creator>
      <dc:date>2018-04-27T20:27:19Z</dc:date>
    </item>
    <item>
      <title>Re: using multiselect to concatenate fields into a compound key</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-multiselect-to-concatenate-fields-into-a-compound-key/m-p/366958#M108241</link>
      <description>&lt;P&gt;Thanks for trying but neither examples work for us.  here is the exact query.  The idea is to use the multiselect on a dashboard to replace what is currently a static list.  The example below highlights one static selection ('host'+ ":"+ 'assetGroup').&lt;/P&gt;

&lt;P&gt;| tstats max("CPU.lpar_vp_usage") AS vp_usage max("CPU.cpu_PCT") AS pct_usage values(CPU.assetGroup) AS assetGroup values(CPU.assetAreaName) AS assetAreaName values(CPU.assetName) AS assetName values(CPU.assetColor) AS assetColor values(CPU.nodeType) AS nodeType values(CPU.nodeGroup) AS nodeGroup values(CPU.cluster) AS cluster values(CPU.awsAutoScalingGroupId) AS awsAutoScalingGroupId&lt;BR /&gt;
from datamodel=NMON_Data_CPU &lt;BR /&gt;
where (nodename = CPU) (CPU.type="CPU_ALL" OR CPU.type="LPAR") (host="&lt;EM&gt;")&lt;BR /&gt;
by _time, host, CPU.assetGroup, CPU.assetAreaName, CPU.assetName span=1m&lt;BR /&gt;
| search (assetGroup="prod") (assetAreaName ="&lt;/EM&gt;") (assetName ="USA") (assetColor = "&lt;EM&gt;") (nodeType="&lt;/EM&gt;") (nodeGroup="&lt;EM&gt;") (cluster ="&lt;/EM&gt;") (awsAutoScalingGroupId="*")&lt;BR /&gt;
| eval dd1='host'+ ":"+ 'assetGroup'&lt;BR /&gt;
| stats dedup_splitvals=t max("pct_usage") AS pct_usage by _time, host, assetGroup, assetAreaName, assetName, dd1&lt;BR /&gt;
| eval usage=if(isnum(vp_usage), vp_usage, pct_usage)&lt;BR /&gt;
| timechart  useother=f limit=0 avg(usage) AS "CPU usage" by dd1&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:23:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-multiselect-to-concatenate-fields-into-a-compound-key/m-p/366958#M108241</guid>
      <dc:creator>mschellhouse</dc:creator>
      <dc:date>2020-09-29T19:23:01Z</dc:date>
    </item>
    <item>
      <title>Re: using multiselect to concatenate fields into a compound key</title>
      <link>https://community.splunk.com/t5/Splunk-Search/using-multiselect-to-concatenate-fields-into-a-compound-key/m-p/366959#M108242</link>
      <description>&lt;P&gt;Answering my own question on this one...&lt;BR /&gt;
A simple delimiter of +":"+ on the multiselect input did the trick.&lt;/P&gt;</description>
      <pubDate>Mon, 30 Apr 2018 15:16:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/using-multiselect-to-concatenate-fields-into-a-compound-key/m-p/366959#M108242</guid>
      <dc:creator>mschellhouse</dc:creator>
      <dc:date>2018-04-30T15:16:28Z</dc:date>
    </item>
  </channel>
</rss>

