<?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 Create Single Field and Multifield Values Based on Same Fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Create-Single-Field-and-Multifield-Values-Based-on-Same-Fields/m-p/703080#M238341</link>
    <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;
&lt;P&gt;How can I create a single value field based on multiple fields? Also, let's assume that the field names can be&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;sample_1_country_1_name to sample_99_country_1_name and sample_1_country_1_name to sample_1_country_99_name. &lt;/LI-CODE&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;sample_1_country sample_2_country sample_99_country sample_37_country
Denmark Chile Thailand Croatia


Result
sample_country_name
Denmark, Chile, Thailand, Croatia&lt;/LI-CODE&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 30 Oct 2024 17:26:02 GMT</pubDate>
    <dc:creator>whitefang1726</dc:creator>
    <dc:date>2024-10-30T17:26:02Z</dc:date>
    <item>
      <title>Create Single Field and Multifield Values Based on Same Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-Single-Field-and-Multifield-Values-Based-on-Same-Fields/m-p/703080#M238341</link>
      <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;
&lt;P&gt;How can I create a single value field based on multiple fields? Also, let's assume that the field names can be&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;sample_1_country_1_name to sample_99_country_1_name and sample_1_country_1_name to sample_1_country_99_name. &lt;/LI-CODE&gt;
&lt;P&gt;Example:&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;sample_1_country sample_2_country sample_99_country sample_37_country
Denmark Chile Thailand Croatia


Result
sample_country_name
Denmark, Chile, Thailand, Croatia&lt;/LI-CODE&gt;
&lt;P&gt;Thanks!&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 17:26:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-Single-Field-and-Multifield-Values-Based-on-Same-Fields/m-p/703080#M238341</guid>
      <dc:creator>whitefang1726</dc:creator>
      <dc:date>2024-10-30T17:26:02Z</dc:date>
    </item>
    <item>
      <title>Re: Create Single Field and Multifield Values Based on Same Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-Single-Field-and-Multifield-Values-Based-on-Same-Fields/m-p/703084#M238342</link>
      <description>&lt;P&gt;The problem with using made-up fake field names is that any proposed solution might not match your actual usecase. However, here is a solution using the names you provided - hopefully you will get the idea and be able to adapt it to your actual usecase&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="sample_1_country,sample_2_country,sample_99_country,sample_37_country
Denmark,Chile,Thailand,Croatia"
| foreach sample_*_country
    [| eval sample_country_name=if(isnull(sample_country_name),&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;,mvappend(sample_country_name,&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;))]
| eval sample_country_name=mvjoin(sample_country_name,",")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 10:15:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-Single-Field-and-Multifield-Values-Based-on-Same-Fields/m-p/703084#M238342</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-10-30T10:15:28Z</dc:date>
    </item>
    <item>
      <title>Re: Create Single Field and Multifield Values Based on Same Fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Create-Single-Field-and-Multifield-Values-Based-on-Same-Fields/m-p/703106#M238354</link>
      <description>&lt;P&gt;Nice, that works sir! Apologies, I just need to update the sample data to avoid oversharing of work items. We have a lot of this fields in our environment. Do you think this is possible using transforms and props? Thanks!&lt;/P&gt;</description>
      <pubDate>Wed, 30 Oct 2024 12:26:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Create-Single-Field-and-Multifield-Values-Based-on-Same-Fields/m-p/703106#M238354</guid>
      <dc:creator>whitefang1726</dc:creator>
      <dc:date>2024-10-30T12:26:58Z</dc:date>
    </item>
  </channel>
</rss>

