<?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: Combine dynamic fields into a multivalued field in a search in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558170#M158535</link>
    <description>&lt;P&gt;It's still blank. Fields didn't get append to the field Combined_Fields. All are showing up as separate fields in the table command and Combined_Fields is empty.&lt;/P&gt;</description>
    <pubDate>Fri, 02 Jul 2021 14:48:54 GMT</pubDate>
    <dc:creator>shivanshu1593</dc:creator>
    <dc:date>2021-07-02T14:48:54Z</dc:date>
    <item>
      <title>Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558156#M158529</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;I'm working on a search, where I currently have the following:&lt;/P&gt;&lt;P&gt;..base search..&lt;/P&gt;&lt;P&gt;| table static_name, static_time, static_title, static_owner,&amp;nbsp; static_id, static_description&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apart from static_title, static_time, static_id, the other fields are dynamic (they change as the search runs with different inputs. static_owner gets replaced by file_name, other fields like fqdn, process, event_hash etc get added to the search)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;What I'm trying to achieve is that the static values, which always are present in the search, should be shown as separate fields, while dynamic fields are merged into a new, multivalued field called Combined_Field, irrespective of the new fields showing up. They should be merged into them.&lt;/P&gt;&lt;P&gt;| table static_time, static_owner, static_id, Combined_Field (a multivalued field, comprising the values of all the dynamic fields)&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;..base search..&lt;/P&gt;&lt;P&gt;| table static_name, static_time, static_title, static_owner,&amp;nbsp; static_id, static_description&lt;/P&gt;&lt;P&gt;| eval Combined_Field = null()&lt;/P&gt;&lt;P&gt;| foreach * [ eval Combined_Field=if('&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'==static_time OR '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'==static_owner OR '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'==static_id, '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;', mvappend('&amp;lt;&amp;lt;field&amp;gt;&amp;gt;', Combined_Field)) ]&lt;/P&gt;&lt;P&gt;| table static_time, static_owner, static_id, Combined_Field&lt;/P&gt;&lt;P&gt;The Combined_Field always remains empty. Could anyone check and let me know as to what am I doing wrong. Or if this can be achieved via a different approach. I've always tried doing the foreach command with case instead of if, no luck.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thank you in advance,&lt;/P&gt;&lt;P&gt;S&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 13:12:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558156#M158529</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2021-07-02T13:12:17Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558160#M158530</link>
      <description>&lt;P&gt;You need to check is Combined_Field is null before trying to mvappend to it.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach * [ eval Combined_Field=if('&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'==static_time OR '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'==static_owner OR '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'==static_id, '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;', if(isnull(Combined_Field),'&amp;lt;&amp;lt;field&amp;gt;&amp;gt;',mvappend('&amp;lt;&amp;lt;field&amp;gt;&amp;gt;', Combined_Field))) ]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Jul 2021 13:25:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558160#M158530</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-02T13:25:55Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558163#M158531</link>
      <description>&lt;P&gt;Hello &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;Thank you for the suggestion. I tried your suggestion, but the field Combined_Fields is still blank.&lt;/P&gt;&lt;P&gt;I used | eval Combined_Fields = null() before foreach. It didn't help either.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 14:01:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558163#M158531</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2021-07-02T14:01:58Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558166#M158533</link>
      <description>&lt;P&gt;Try the fields in the other order in the mvappend&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach * [ eval Combined_Field=if('&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'==static_time OR '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'==static_owner OR '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'==static_id, '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;', if(isnull(Combined_Field),'&amp;lt;&amp;lt;field&amp;gt;&amp;gt;',mvappend(Combined_Field,'&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'))) ]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Jul 2021 14:41:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558166#M158533</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-02T14:41:44Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558170#M158535</link>
      <description>&lt;P&gt;It's still blank. Fields didn't get append to the field Combined_Fields. All are showing up as separate fields in the table command and Combined_Fields is empty.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 14:48:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558170#M158535</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2021-07-02T14:48:54Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558172#M158537</link>
      <description>&lt;P&gt;Did you put the field names in double quotes - also, you should check if &amp;lt;&amp;lt;field&amp;gt;&amp;gt; is Combined_Field so it doesn't get duplicated.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach * [ eval Combined_Field=if('&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'=="static_time" OR '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'=="static_owner" OR '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'=="static_id" OR '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'=="Combined_Field", '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;', if(isnull(Combined_Field),'&amp;lt;&amp;lt;field&amp;gt;&amp;gt;',mvappend(Combined_Field,'&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'))) ]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Jul 2021 14:54:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558172#M158537</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-02T14:54:07Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558175#M158538</link>
      <description>&lt;P&gt;I did try running the search with field names under double quotes, it still remained blank.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Regarding &amp;lt;&amp;lt;field&amp;gt;&amp;gt; not being Combined_Fields, not really sure how to check that. Could you please point me to a direction, using which I can take a look.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 15:07:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558175#M158538</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2021-07-02T15:07:03Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558178#M158540</link>
      <description>&lt;P&gt;I had included it already - thinking about it, perhaps you need the &amp;lt;&amp;lt;field&amp;gt;&amp;gt; in double quotes too when checking for the names.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach * [ eval Combined_Field=if("&amp;lt;&amp;lt;field&amp;gt;&amp;gt;"=="static_time" OR "&amp;lt;&amp;lt;field&amp;gt;&amp;gt;"=="static_owner" OR "&amp;lt;&amp;lt;field&amp;gt;&amp;gt;"=="static_id" OR "&amp;lt;&amp;lt;field&amp;gt;&amp;gt;"=="Combined_Field", '&amp;lt;&amp;lt;field&amp;gt;&amp;gt;', if(isnull(Combined_Field),'&amp;lt;&amp;lt;field&amp;gt;&amp;gt;',mvappend(Combined_Field,'&amp;lt;&amp;lt;field&amp;gt;&amp;gt;'))) ]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Jul 2021 15:23:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558178#M158540</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-02T15:23:29Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558181#M158542</link>
      <description>&lt;P&gt;I tried with "&amp;lt;&amp;lt;field&amp;gt;&amp;gt;"&amp;nbsp; as well. Still no results. It's a puzzler. Not really sure what's not working here.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 15:51:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558181#M158542</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2021-07-02T15:51:21Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558186#M158544</link>
      <description>&lt;P&gt;Try with &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 17:34:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558186#M158544</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-02T17:34:21Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558187#M158545</link>
      <description>&lt;P&gt;Tried that too. On passing &amp;lt;&amp;lt;field&amp;gt;&amp;gt; without any quotes around it, the if statement fails.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 17:44:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558187#M158545</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2021-07-02T17:44:49Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558189#M158547</link>
      <description>&lt;P&gt;I meant use FIELD in caps not lowercase&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 17:46:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558189#M158547</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-02T17:46:59Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558190#M158548</link>
      <description>&lt;P&gt;My bad. I tried with &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; and it has appended all the values, including static_time, static_owner, static_id, which we tried to filter out in the if block.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 18:14:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558190#M158548</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2021-07-02T18:14:45Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558202#M158551</link>
      <description>&lt;P&gt;So you need caps and double quotes&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| foreach * [ eval Combined_Field=if("&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"=="static_time" OR "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"=="static_owner" OR "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"=="static_id" OR "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"=="Combined_Field", '&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;', if(isnull(Combined_Field),'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;',mvappend(Combined_Field,'&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;'))) ]&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 02 Jul 2021 20:03:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558202#M158551</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-02T20:03:37Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558210#M158553</link>
      <description>&lt;P&gt;I've tried to implement that, but its messing up with the fields. There are 17 fields in total in the current iteration, 14 should be in the multivalued field and 3 outside. However, using double quotes and captial fields is reducing the number of fields in the multivalued field down to 8.&lt;/P&gt;</description>
      <pubDate>Fri, 02 Jul 2021 21:54:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558210#M158553</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2021-07-02T21:54:12Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558220#M158560</link>
      <description>&lt;P&gt;So the process works? Now, it is down to the actual field names. Which field names work, and which ones don't?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Jul 2021 07:00:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558220#M158560</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-07-03T07:00:33Z</dc:date>
    </item>
    <item>
      <title>Re: Combine dynamic fields into a multivalued field in a search</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558334#M158591</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;None of the fields are working. All of them are present in the multivalued field, Combined_Fields. On covering them and &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; in double quotes, they still land up in the multivalued field.&lt;/P&gt;&lt;P&gt;When I put "&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;"&amp;nbsp; == "Combined_Field", then out of 17 fields of this iteration, at least 4 disappear from the multivalued field, leaving only 10 in there instead of 14.&lt;/P&gt;</description>
      <pubDate>Mon, 05 Jul 2021 17:01:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Combine-dynamic-fields-into-a-multivalued-field-in-a-search/m-p/558334#M158591</guid>
      <dc:creator>shivanshu1593</dc:creator>
      <dc:date>2021-07-05T17:01:31Z</dc:date>
    </item>
  </channel>
</rss>

