<?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 prevent values from appearing twice in a single cell of a table in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-values-from-appearing-twice-in-a-single-cell-of-a/m-p/548701#M155665</link>
    <description>&lt;P&gt;Try &lt;FONT face="courier new,courier"&gt;mvexpand&lt;/FONT&gt;.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=purchase_store_x1
| rex mode=sed "s/^(?i)(?:(?!{).)+//g"
| spath
| search BodyJson.name="pdone.ok"
| rename BodyJson.product.ID as PRODUCT
| rename BodyJson.ID.CX.Unique as ID
| mvexpand PRODUCT
| table ID PRODUCT
| sort -ID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Wed, 21 Apr 2021 00:29:59 GMT</pubDate>
    <dc:creator>richgalloway</dc:creator>
    <dc:date>2021-04-21T00:29:59Z</dc:date>
    <item>
      <title>How to prevent values from appearing twice in a single cell of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-values-from-appearing-twice-in-a-single-cell-of-a/m-p/548694#M155664</link>
      <description>&lt;P&gt;Hello Everyone I hope you are safe and sound,&lt;/P&gt;&lt;P&gt;I'm extracting values from events that come in a Json format and after that I want to create a Table were I can see each ID and the product thy bought from the store but I am always getting within a single cell the same value repeated two times and when I try to do a stats count then... it is also count twice...&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;This is my code:

index=purchase_store_x1
| rex mode=sed "s/^(?i)(?:(?!{).)+//g"
| spath
| search BodyJson.name="pdone.ok"
| rename BodyJson.product.ID as PRODUCT
| rename BodyJson.ID.CX.Unique as ID
| table ID PRODUCT
| sort -ID&lt;/LI-CODE&gt;&lt;P&gt;and so instead of getting the ID asociaed with the product purchased I get something like this:&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="22px"&gt;ID&lt;/TD&gt;&lt;TD width="50%" height="22px"&gt;PRODUCT&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="43px"&gt;31254&lt;BR /&gt;31254&lt;/TD&gt;&lt;TD width="50%" height="43px"&gt;XUI45&lt;BR /&gt;XUI45&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="43px"&gt;54581&lt;BR /&gt;54581&lt;/TD&gt;&lt;TD width="50%" height="43px"&gt;XUI8&lt;BR /&gt;XUI45&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="43px"&gt;47851&lt;BR /&gt;47851&lt;/TD&gt;&lt;TD width="50%" height="43px"&gt;XUIE58&lt;BR /&gt;XUI45&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&lt;BR /&gt;How can I just a normal table without having the same value repeated twice in the cell? THANK YOU SO MUCH for your help,&lt;/P&gt;</description>
      <pubDate>Tue, 20 Apr 2021 23:06:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-values-from-appearing-twice-in-a-single-cell-of-a/m-p/548694#M155664</guid>
      <dc:creator>andres91302</dc:creator>
      <dc:date>2021-04-20T23:06:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent values from appearing twice in a single cell of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-values-from-appearing-twice-in-a-single-cell-of-a/m-p/548701#M155665</link>
      <description>&lt;P&gt;Try &lt;FONT face="courier new,courier"&gt;mvexpand&lt;/FONT&gt;.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=purchase_store_x1
| rex mode=sed "s/^(?i)(?:(?!{).)+//g"
| spath
| search BodyJson.name="pdone.ok"
| rename BodyJson.product.ID as PRODUCT
| rename BodyJson.ID.CX.Unique as ID
| mvexpand PRODUCT
| table ID PRODUCT
| sort -ID&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 00:29:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-values-from-appearing-twice-in-a-single-cell-of-a/m-p/548701#M155665</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2021-04-21T00:29:59Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent values from appearing twice in a single cell of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-values-from-appearing-twice-in-a-single-cell-of-a/m-p/548702#M155666</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/232004"&gt;@andres91302&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;It looks like ID is always duplicated, but product can be different, so if that's the case&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;..your_search..
| eval ID=mvdedup(ID), PRODUCT=mvdedup(PRODUCT)
| table ID PRODUCT
| sort -ID&lt;/LI-CODE&gt;&lt;P&gt;or&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;..your_search..
| eval ID=mvdedup(ID)
| stats values(PRODUCT) by ID
| sort -ID&lt;/LI-CODE&gt;&lt;P&gt;use whichever suits your data better&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 00:49:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-values-from-appearing-twice-in-a-single-cell-of-a/m-p/548702#M155666</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-04-21T00:49:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent values from appearing twice in a single cell of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-values-from-appearing-twice-in-a-single-cell-of-a/m-p/548706#M155667</link>
      <description>&lt;P&gt;Thank you so much for your help this was excellent&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 02:44:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-values-from-appearing-twice-in-a-single-cell-of-a/m-p/548706#M155667</guid>
      <dc:creator>andres91302</dc:creator>
      <dc:date>2021-04-21T02:44:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to prevent values from appearing twice in a single cell of a table</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-values-from-appearing-twice-in-a-single-cell-of-a/m-p/548707#M155668</link>
      <description>&lt;P&gt;Thank you so much! 10/10&lt;/P&gt;</description>
      <pubDate>Wed, 21 Apr 2021 02:45:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-prevent-values-from-appearing-twice-in-a-single-cell-of-a/m-p/548707#M155668</guid>
      <dc:creator>andres91302</dc:creator>
      <dc:date>2021-04-21T02:45:32Z</dc:date>
    </item>
  </channel>
</rss>

