<?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: Join fields together in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702989#M238313</link>
    <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/270694"&gt;@JandrevdM&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;do you know the max number of emails?&lt;/P&gt;&lt;P&gt;if they are fixed (always the same quantity), you could use nomv and then a regex to divide the emails.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
    <pubDate>Tue, 29 Oct 2024 10:53:03 GMT</pubDate>
    <dc:creator>gcusello</dc:creator>
    <dc:date>2024-10-29T10:53:03Z</dc:date>
    <item>
      <title>Join fields together</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702973#M238304</link>
      <description>&lt;P&gt;Good day,&lt;BR /&gt;&lt;BR /&gt;Is there a way to join all my rows into one?&lt;BR /&gt;&lt;BR /&gt;My simple query&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=collect_identities sourcetype=ldap:query user
| dedup email
| table email extensionAttribute10 extensionAttribute11 first last identity&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Shows results as, as I have more than one email&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;email&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;extensionAttribute10&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;extensionAttribute11&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;first&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;last&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;identity&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;user@domain.com&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;user@consultant.com&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;User&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;Surname&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;USurname&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;userT1@domain.com&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;user@domain.com&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;user@domain.com&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;User&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;Surname&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;USurname&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;userT0@domain.com&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;user@domain.com&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;user@domain.com&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;User&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;Surname&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;USurname&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;I want to add a primary key that searches for "user@domain.com" and display all their email addresses that they have in one row.&amp;nbsp;&lt;BR /&gt;Example&lt;/P&gt;&lt;TABLE border="1" width="105.11795281887247%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="25px"&gt;email&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="25px"&gt;extensionAttribute10&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="25px"&gt;extensionAttribute11&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="25px"&gt;first&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="25px"&gt;last&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="25px"&gt;identity&lt;/TD&gt;&lt;TD width="7.142857142857143%" height="25px"&gt;email2&lt;/TD&gt;&lt;TD width="7.142857142857143%"&gt;email3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="14.285714285714286%" height="25px"&gt;user@domain.com&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="25px"&gt;user@domain.com&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="25px"&gt;user@consultant.com&amp;nbsp;&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="25px"&gt;User&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="25px"&gt;Surname&lt;/TD&gt;&lt;TD width="14.285714285714286%" height="25px"&gt;USurname&lt;/TD&gt;&lt;TD width="7.142857142857143%" height="25px"&gt;userT1@domain.com&lt;/TD&gt;&lt;TD width="7.142857142857143%"&gt;userT0@domain.com&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 29 Oct 2024 08:44:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702973#M238304</guid>
      <dc:creator>JandrevdM</dc:creator>
      <dc:date>2024-10-29T08:44:31Z</dc:date>
    </item>
    <item>
      <title>Re: Join fields together</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702974#M238305</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/270694"&gt;@JandrevdM&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;you must find a common key between the records, if identity is your key, you could try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| stats 
     values(email) AS email
     values(extensionAttribute10) AS extensionAttribute10
     values(extensionAttribute119 AS extensionAttribute11
     values(first) AS first
     values(last) AS last
     BY identity&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 08:50:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702974#M238305</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-10-29T08:50:43Z</dc:date>
    </item>
    <item>
      <title>Re: Join fields together</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702976#M238307</link>
      <description>&lt;P&gt;Thanks is there any way to split it, I tried this but it is not working&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=collect_identities sourcetype=ldap:query 
| dedup email
| eval identity=replace(identity, "Adm0", "")
| eval identity=replace(identity, "Adm", "")
| eval identity=lower(identity)
| stats 
    values(email) AS email
    values(extensionAttribute10) AS extensionAttribute10
    values(extensionAttribute11) AS extensionAttribute11
    values(first) AS first
    values(last) AS last
    BY identity
| eval email=split(email, "")
| eval extensionAttribute10=split(extensionAttribute10, "")
| eval extensionAttribute11=split(extensionAttribute11, "")
| eval first=split(first, "")
| eval last=split(last, "")
| mvexpand email
| mvexpand extensionAttribute10
| mvexpand extensionAttribute11
| mvexpand first
| mvexpand last&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 29 Oct 2024 09:28:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702976#M238307</guid>
      <dc:creator>JandrevdM</dc:creator>
      <dc:date>2024-10-29T09:28:26Z</dc:date>
    </item>
    <item>
      <title>Re: Join fields together</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702985#M238309</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/270694"&gt;@JandrevdM&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;what do you mean with "split"?&lt;/P&gt;&lt;P&gt;if you have a multivalue field, you could try with mvexpand to have a row for each value or nomv to have all the values in one row.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 10:21:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702985#M238309</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-10-29T10:21:33Z</dc:date>
    </item>
    <item>
      <title>Re: Join fields together</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702987#M238311</link>
      <description>&lt;P&gt;Instead of having&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="100%"&gt;email&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="100%"&gt;&lt;A href="mailto:user1@domain.com" target="_blank"&gt;user@domain.com&lt;/A&gt;&lt;BR /&gt;userT1@domain.com&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;I would like to then split it&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%"&gt;email 1&lt;/TD&gt;&lt;TD width="50%"&gt;email 2&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%"&gt;user@domain.com&lt;/TD&gt;&lt;TD width="50%"&gt;userT2@domain.com&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Tue, 29 Oct 2024 10:27:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702987#M238311</guid>
      <dc:creator>JandrevdM</dc:creator>
      <dc:date>2024-10-29T10:27:02Z</dc:date>
    </item>
    <item>
      <title>Re: Join fields together</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702989#M238313</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/270694"&gt;@JandrevdM&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;do you know the max number of emails?&lt;/P&gt;&lt;P&gt;if they are fixed (always the same quantity), you could use nomv and then a regex to divide the emails.&lt;/P&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 10:53:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702989#M238313</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-10-29T10:53:03Z</dc:date>
    </item>
    <item>
      <title>Re: Join fields together</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702990#M238314</link>
      <description>&lt;P&gt;Well, you probably can using the foreach command and the {} notation (or alternatively using some mv* magic with kv command in the rnd) but the question is - what for. It's usually the other way around that's the problem - to normalize your data when you have multiple fields holding "the same" data.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 11:05:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702990#M238314</guid>
      <dc:creator>PickleRick</dc:creator>
      <dc:date>2024-10-29T11:05:42Z</dc:date>
    </item>
    <item>
      <title>Re: Join fields together</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702991#M238315</link>
      <description>&lt;P&gt;I do not know the number of max emails. But I believe the first answer will be sufficient and I will try and work around it on my join&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 11:14:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702991#M238315</guid>
      <dc:creator>JandrevdM</dc:creator>
      <dc:date>2024-10-29T11:14:09Z</dc:date>
    </item>
    <item>
      <title>Re: Join fields together</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702993#M238317</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/270694"&gt;@JandrevdM&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;&lt;P&gt;good for you, see next time!&lt;/P&gt;&lt;P&gt;let us know if we can help you more, or, please, accept one answer for the other people of Community.&lt;/P&gt;&lt;P&gt;Ciao and happy splunking&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;&lt;P&gt;P.S.: Karma Points are appreciated by all the contributors &lt;span class="lia-unicode-emoji" title=":winking_face:"&gt;😉&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Oct 2024 11:24:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/702993#M238317</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2024-10-29T11:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: Join fields together</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/703074#M238338</link>
      <description>&lt;P&gt;The problem here is unclear requirement: What is the logic to collapse the three rows after dedup into that single row?&lt;/P&gt;&lt;OL&gt;&lt;LI&gt;As &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;speculates, the three rows have common values of identity. &amp;nbsp;Is this correct? Such should be be stated explicitly.&lt;/LI&gt;&lt;LI&gt;The mock data also shows identical first and last for the three rows. &amp;nbsp;Is this always true? &amp;nbsp;Such should be stated explicitly, too.&lt;/LI&gt;&lt;LI&gt;More intricately, the mock data contains different values of extensionAttribute11 and extensionAttribute10. &amp;nbsp;What are the criteria of choosing one or another from these differing values in the collapsed table? &amp;nbsp;Volunteers here cannot read minds.&lt;/LI&gt;&lt;LI&gt;extensionAttribute10 in one of the three rows is blank; that in the rest rows is the same value. &amp;nbsp;One can reasonably speculate that you want the non-blank value to be used in the collapsed table. &amp;nbsp;But is this speculation correct? &amp;nbsp;Are all non-blank values identical? &amp;nbsp;Again, do not make volunteers read your mind.&lt;/LI&gt;&lt;LI&gt;Additionally, what is the logic to determine which value remains with field name email, which goes to email2, email3, etc.?&lt;/LI&gt;&lt;/OL&gt;&lt;P&gt;In the following example, I'll take arbitrary selection among emails (5), take every value of extensionAttribute11 (3), and take affirmative in (4). &amp;nbsp;You get&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD&gt;email&lt;/TD&gt;&lt;TD&gt;extensionAtttribute10&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;extensionAttribute11&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;first&lt;/TD&gt;&lt;TD&gt;last&lt;/TD&gt;&lt;TD&gt;identity&lt;/TD&gt;&lt;TD&gt;email2&lt;/TD&gt;&lt;TD&gt;email3&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD&gt;user@domain.com&lt;/TD&gt;&lt;TD&gt;user@domain.com&lt;/TD&gt;&lt;TD&gt;&lt;DIV class=""&gt;user@consultant.com&lt;/DIV&gt;&lt;DIV class=""&gt;user@domain.com&lt;/DIV&gt;&lt;/TD&gt;&lt;TD&gt;User&lt;/TD&gt;&lt;TD&gt;Surname&lt;/TD&gt;&lt;TD&gt;USurname&lt;/TD&gt;&lt;TD&gt;userT0@domain.com&lt;/TD&gt;&lt;TD&gt;userT1@domain.com&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;This the search&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=collect_identities sourcetype=ldap:query user
| stats values(*) as * by first last identity
| eval idx = mvrange(1, mvcount(email))
| eval json = json_object()
| foreach idx mode=multivalue
    [eval ordinal = &amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt; + 1, json = json_set(json, "email" . ordinal, mvindex(email, &amp;lt;&amp;lt;ITEM&amp;gt;&amp;gt;))]
| spath input=json
| eval email = mvindex(email, 0)
| table email extension* first last identity email*&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(Of course, you can reduce extensionAttribute11 to one value if you know the logic.) &amp;nbsp;Here is an emulation. Play with it and compare with real data.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults format=csv data="email,	extensionAttribute10,	extensionAttribute11,	first,	last,	identity
user@domain.com,	 ,	user@consultant.com,	User,	Surname,	USurname
userT1@domain.com,	user@domain.com,	user@domain.com,	User,	Surname,	USurname
userT0@domain.com,	user@domain.com,	user@domain.com,	User,	Surname,	USurname"
``` the above emulates
index=collect_identities sourcetype=ldap:query user
```&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 08:40:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Join-fields-together/m-p/703074#M238338</guid>
      <dc:creator>yuanliu</dc:creator>
      <dc:date>2024-10-30T08:40:09Z</dc:date>
    </item>
  </channel>
</rss>

