<?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: How to dedup multivalued fields? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537287#M151870</link>
    <description>&lt;P&gt;So, we believe the data coming in from the indexer has some sort of line break and so "Spitting" the fields won't work.&amp;nbsp; I talked to another engineer at work and he said he may require a "Regex" statement.&amp;nbsp; I'll keep this thread updated.&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 26 Jan 2021 19:48:15 GMT</pubDate>
    <dc:creator>UMDTERPS</dc:creator>
    <dc:date>2021-01-26T19:48:15Z</dc:date>
    <item>
      <title>How to dedup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537139#M151825</link>
      <description>&lt;P&gt;Some of the data coming in from one of our indexes is doing the following( It appears data is repeating for each field):&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;ip&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; User&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;System&lt;BR /&gt;192.168.1.1&amp;nbsp;192.168.1.1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; BOB BOB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ABC ABC&lt;BR /&gt;&lt;BR /&gt;How can I get the data so it only shows one field value per field? (how to get it to stop repeating the same data in each field)?&lt;/P&gt;&lt;P&gt;ip&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;User&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; System&lt;BR /&gt;192.168.1.1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;BOB&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;ABC&lt;/P&gt;&lt;P&gt;Dedup obviously won't work in this instance.&amp;nbsp;&lt;BR /&gt;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 25 Jan 2021 22:54:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537139#M151825</guid>
      <dc:creator>UMDTERPS</dc:creator>
      <dc:date>2021-01-25T22:54:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537197#M151845</link>
      <description>&lt;P&gt;Are you saying that the indexer has created a multivalue field with duplicate values in for some (or all?) of your events, or are these multivalue fields the result of a search query?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 11:56:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537197#M151845</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-01-26T11:56:14Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537211#M151848</link>
      <description>&lt;P&gt;Hey,&amp;nbsp;&lt;BR /&gt;I'm relatively new to Splunk so I don't know if there is a more elegant way to do this but the following code should work just fine:&lt;BR /&gt;&lt;BR /&gt;| makemv ip&lt;BR /&gt;| makemv user&lt;BR /&gt;| makemv system&lt;BR /&gt;| mvexpand ip&lt;BR /&gt;| mvexpand user&lt;BR /&gt;| mvexpand system&lt;BR /&gt;| dedup user ip system&lt;BR /&gt;&lt;BR /&gt;This should output a row for every combination in your source excluding the duplicates.&lt;BR /&gt;If the fields are already multivalue then you can skip all the "Makemv" lines!&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 13:30:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537211#M151848</guid>
      <dc:creator>FelixLeh</dc:creator>
      <dc:date>2021-01-26T13:30:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537231#M151855</link>
      <description>&lt;P&gt;Unfortunately that does not work.&amp;nbsp;&lt;span class="lia-unicode-emoji" title=":slightly_frowning_face:"&gt;🙁&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 15:38:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537231#M151855</guid>
      <dc:creator>UMDTERPS</dc:creator>
      <dc:date>2021-01-26T15:38:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537232#M151856</link>
      <description>&lt;P&gt;That I'm not sure about, there could be an issues to how the data is getting in or out of the indexer.&amp;nbsp; I don't have admin rights (im not the admin), but this issue is preventing be from doing lookups and/or joins on the data with CSV's.&amp;nbsp;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 15:39:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537232#M151856</guid>
      <dc:creator>UMDTERPS</dc:creator>
      <dc:date>2021-01-26T15:39:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537256#M151859</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/160636"&gt;@UMDTERPS&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;If fields values are multivalue, you can use below workaround for a few fields.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval ip=mvindex(split(ip," "),0)
| eval User=mvindex(split(User," "),0)
| eval System=mvindex(split(System," "),0)&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 17:09:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537256#M151859</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-01-26T17:09:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537265#M151862</link>
      <description>&lt;P&gt;I'm still getting the same IP address repeated for each field when doing&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval ip=mvindex(split(ip," "),0)
| eval User=mvindex(split(User," "),0)
| eval System=mvindex(split(System," "),0)&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;ip&lt;BR /&gt;198.168.1.1&lt;BR /&gt;198.168.1.1&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;Weird. Wonder if it is something is off with the data?&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 17:42:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537265#M151862</guid>
      <dc:creator>UMDTERPS</dc:creator>
      <dc:date>2021-01-26T17:42:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537269#M151864</link>
      <description>&lt;P&gt;What if we do not split?&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval ip=mvindex(ip,0)
| eval User=mvindex(User,0)
| eval System=mvindex(System,0)&lt;/LI-CODE&gt;</description>
      <pubDate>Tue, 26 Jan 2021 17:45:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537269#M151864</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-01-26T17:45:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537287#M151870</link>
      <description>&lt;P&gt;So, we believe the data coming in from the indexer has some sort of line break and so "Spitting" the fields won't work.&amp;nbsp; I talked to another engineer at work and he said he may require a "Regex" statement.&amp;nbsp; I'll keep this thread updated.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 26 Jan 2021 19:48:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537287#M151870</guid>
      <dc:creator>UMDTERPS</dc:creator>
      <dc:date>2021-01-26T19:48:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537333#M151893</link>
      <description>&lt;P&gt;If you can provide a few sample events, we can help better.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 03:26:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537333#M151893</guid>
      <dc:creator>scelikok</dc:creator>
      <dc:date>2021-01-27T03:26:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537352#M151907</link>
      <description>&lt;P&gt;You should be able to use replace+regex to change that line break to a space and then split/dedup on that, e.g.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval ip=mvdedup(split(replace(ip, "\n", " "), " "))&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 27 Jan 2021 06:31:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537352#M151907</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-01-27T06:31:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to dedup multivalued fields?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537476#M151950</link>
      <description>&lt;P&gt;This worked!&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval ip=mvdedup(split(replace(ip, "\n", " "), " "))&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;An engineer at work gave me this (yours is better):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|rex mode=sed "s/([0-9\.]+)\n.*/\1/g" field=ip&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;However, it only works for the ip field and you would have to create a custom regex for each field.&amp;nbsp; I will have to get with the admin to fix the data coming in.&amp;nbsp; Also, we had an issue with the data getting formatted in each field, where it made the data look like a giant column.&amp;nbsp; This was the fix:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;|eval ip = replace(ip, "\n", " ")&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jan 2021 18:30:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-dedup-multivalued-fields/m-p/537476#M151950</guid>
      <dc:creator>UMDTERPS</dc:creator>
      <dc:date>2021-01-27T18:30:02Z</dc:date>
    </item>
  </channel>
</rss>

