<?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 Join multiple fields into few unique field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-multiple-fields-into-few-unique-field/m-p/555712#M157757</link>
    <description>&lt;P&gt;Hi,&lt;BR /&gt;I'm looking something similar to this, but please note that the description* wildcard can go up to 20+ fields, same goes to weight_*&lt;BR /&gt;I do tried &lt;FONT color="#FF0000"&gt;foreach [|eval ] + coalesce(),&lt;/FONT&gt; not sure why some of my field values missing after the foreach loop.&lt;BR /&gt;just asking if there is another method other than foreach[]&lt;BR /&gt;&lt;BR /&gt;my search...&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;product&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;description1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;description2&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;weight_a&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;weight_b&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;weight_c&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;product_a&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;string_a&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;string_b&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;number_a&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;number_b&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;number_c&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;product_b&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;string_c&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;string_d&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;number_d&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;number_e&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;number_f&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="18px"&gt;product_c&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="18px"&gt;string_e&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="18px"&gt;string_f&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="18px"&gt;number_g&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="18px"&gt;number_h&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="18px"&gt;number_i&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;desired output&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;product&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;description&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;weight&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;product_a&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;description1=string_a&lt;BR /&gt;description2=string_b&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;&lt;P&gt;weight_a=number_a&lt;/P&gt;&lt;P&gt;weight_b=number_b&lt;/P&gt;&lt;P&gt;weight_c=number_c&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;product_b&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;description1=string_c&lt;BR /&gt;description2=string_d&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;&lt;P&gt;weight_a=number_d&lt;/P&gt;&lt;P&gt;weight_b=number_e&lt;/P&gt;&lt;P&gt;weight_c=number_f&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;product_c&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;description1=string_e&lt;BR /&gt;description2=string_f&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;&lt;P&gt;weight_a=number_g&lt;/P&gt;&lt;P&gt;weight_b=number_g&lt;/P&gt;&lt;P&gt;weight_c=number_i&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
    <pubDate>Tue, 15 Jun 2021 03:26:34 GMT</pubDate>
    <dc:creator>yuming1127</dc:creator>
    <dc:date>2021-06-15T03:26:34Z</dc:date>
    <item>
      <title>Join multiple fields into few unique field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-multiple-fields-into-few-unique-field/m-p/555712#M157757</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;I'm looking something similar to this, but please note that the description* wildcard can go up to 20+ fields, same goes to weight_*&lt;BR /&gt;I do tried &lt;FONT color="#FF0000"&gt;foreach [|eval ] + coalesce(),&lt;/FONT&gt; not sure why some of my field values missing after the foreach loop.&lt;BR /&gt;just asking if there is another method other than foreach[]&lt;BR /&gt;&lt;BR /&gt;my search...&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;product&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;description1&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;description2&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;weight_a&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;weight_b&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;weight_c&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;product_a&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;string_a&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;string_b&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;number_a&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;number_b&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;number_c&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;product_b&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;string_c&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;string_d&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;number_d&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;number_e&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;number_f&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="18px"&gt;product_c&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="18px"&gt;string_e&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="18px"&gt;string_f&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="18px"&gt;number_g&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="18px"&gt;number_h&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="18px"&gt;number_i&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;desired output&amp;nbsp;&lt;/P&gt;&lt;TABLE border="1"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;product&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;description&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;weight&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;product_a&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;description1=string_a&lt;BR /&gt;description2=string_b&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;&lt;P&gt;weight_a=number_a&lt;/P&gt;&lt;P&gt;weight_b=number_b&lt;/P&gt;&lt;P&gt;weight_c=number_c&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;product_b&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;description1=string_c&lt;BR /&gt;description2=string_d&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;&lt;P&gt;weight_a=number_d&lt;/P&gt;&lt;P&gt;weight_b=number_e&lt;/P&gt;&lt;P&gt;weight_c=number_f&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;product_c&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;description1=string_e&lt;BR /&gt;description2=string_f&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="24px"&gt;&lt;P&gt;weight_a=number_g&lt;/P&gt;&lt;P&gt;weight_b=number_g&lt;/P&gt;&lt;P&gt;weight_c=number_i&lt;/P&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks in advance.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 03:26:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-multiple-fields-into-few-unique-field/m-p/555712#M157757</guid>
      <dc:creator>yuming1127</dc:creator>
      <dc:date>2021-06-15T03:26:34Z</dc:date>
    </item>
    <item>
      <title>Re: Join multiple fields into few unique field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-multiple-fields-into-few-unique-field/m-p/555714#M157759</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/233446"&gt;@yuming1127&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Can you please try this?&lt;/P&gt;&lt;P&gt;With your provided sample data this will work.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
| fields  product	description1	description2	weight_a	weight_b	weight_c
| eval description=mvappend("description1=".description1,"description2=".description2)
| eval weight=mvappend("weight_a=".weight_a,"weight_b=".weight_b,"weight_c=".weight_c)
| table  product description weight&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="product	description1	description2	weight_a	weight_b	weight_c
product_a	string_a	string_b	number_a	number_b	number_c
product_b	string_c	string_d	number_d	number_e	number_f
product_c	string_e	string_f	number_g	number_h	number_i"| multikv  forceheader=1
| fields  product	description1	description2	weight_a	weight_b	weight_c
| eval description=mvappend("description1=".description1,"description2=".description2)
| eval weight=mvappend("weight_a=".weight_a,"weight_b=".weight_b,"weight_c=".weight_c)
| table  product description weight&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;in case of multiple&amp;nbsp;description and weight fields try this.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;YOUR_SEARCH
| fields  product	description1	description2	weight_a	weight_b	weight_c
| foreach description* [| eval description=mvappend(description,"&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;="+'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')]
| foreach weight_* [| eval weight=mvappend(weight,"&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;="+'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')]
| table  product description weight&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;&lt;STRONG&gt;My Sample Search :&lt;/STRONG&gt;&lt;BR /&gt;&lt;/STRONG&gt;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults | eval _raw="product	description1	description2	weight_a	weight_b	weight_c
product_a	string_a	string_b	number_a	number_b	number_c
product_b	string_c	string_d	number_d	number_e	number_f
product_c	string_e	string_f	number_g	number_h	number_i"| multikv  forceheader=1
| fields  product	description1	description2	weight_a	weight_b	weight_c
| foreach description* [| eval description=mvappend(description,"&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;="+'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')]
| foreach weight_* [| eval weight=mvappend(weight,"&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;="+'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;')]
| table  product description weight&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks&lt;BR /&gt;KV&lt;BR /&gt;▄︻̷̿┻̿═━一&lt;BR /&gt;&lt;BR /&gt;If any of my reply helps you to solve the problem Or gain knowledge, an upvote would be appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 15 Jun 2021 04:39:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-multiple-fields-into-few-unique-field/m-p/555714#M157759</guid>
      <dc:creator>kamlesh_vaghela</dc:creator>
      <dc:date>2021-06-15T04:39:09Z</dc:date>
    </item>
  </channel>
</rss>

