<?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: Copy Field and remove duplicate in Getting Data In</title>
    <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338821#M62523</link>
    <description>&lt;P&gt;when i write |eval records_after_dedup=records&lt;BR /&gt;
it won't copy all records , it will only add new column called "records_after_dedup" where the name records is written as below &lt;/P&gt;

&lt;P&gt;records_after_dedup&lt;BR /&gt;
records&lt;BR /&gt;
records&lt;BR /&gt;
records&lt;BR /&gt;
records&lt;BR /&gt;
...&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 14:24:26 GMT</pubDate>
    <dc:creator>wessam</dc:creator>
    <dc:date>2020-09-29T14:24:26Z</dc:date>
    <item>
      <title>Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338813#M62515</link>
      <description>&lt;P&gt;Hello All,&lt;/P&gt;

&lt;P&gt;I have a column list of records as below &lt;/P&gt;

&lt;P&gt;recordA&lt;BR /&gt;
recordB&lt;BR /&gt;
recordA&lt;BR /&gt;
RecordB&lt;BR /&gt;
RecordC&lt;BR /&gt;
RecordD&lt;/P&gt;

&lt;P&gt;and I would like to remove duplicate and copy them in another column to have finally a column for all records (records) and second record for records after dedup (record_after_dedup)&lt;BR /&gt;
I tried to use eval with dedup but it doesn't work &lt;/P&gt;

&lt;P&gt;eval record_after_dedup=dedup(records)&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:23:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338813#M62515</guid>
      <dc:creator>wessam</dc:creator>
      <dc:date>2020-09-29T14:23:30Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338814#M62516</link>
      <description>&lt;P&gt;Do you want ignore the case and remove duplicates?&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 09:39:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338814#M62516</guid>
      <dc:creator>dineshraj9</dc:creator>
      <dc:date>2017-06-07T09:39:59Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338815#M62517</link>
      <description>&lt;P&gt;yes, i just need to have two columns the first one includes all the records and second one include the records after removing duplicates&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 09:43:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338815#M62517</guid>
      <dc:creator>wessam</dc:creator>
      <dc:date>2017-06-07T09:43:22Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338816#M62518</link>
      <description>&lt;P&gt;The number of rows would differ once you have removed the duplicates, instead use a multi-valued field -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | eval record_new=lower(records) | stats values(records) as records,values(records_new) as records_after_dedup
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Jun 2017 09:47:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338816#M62518</guid>
      <dc:creator>dineshraj9</dc:creator>
      <dc:date>2017-06-07T09:47:47Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338817#M62519</link>
      <description>&lt;P&gt;Sorry i think there is misunderstanding , i am not asking to remove duplicates for lower and upper case or to ignore them , I am only asking to remove duplicates :&lt;BR /&gt;
for Ex :&lt;BR /&gt;
100&lt;BR /&gt;
50&lt;BR /&gt;
20&lt;BR /&gt;
50 &lt;BR /&gt;
100&lt;BR /&gt;
 the above column contains all the record , i would like to have two columns first one "Records" for all the records and the second one "Records after dedup" for records after removing duplicate &lt;BR /&gt;
to be as below &lt;BR /&gt;
Records :&lt;BR /&gt;
100&lt;BR /&gt;
50&lt;BR /&gt;
20&lt;BR /&gt;
50 &lt;BR /&gt;
100&lt;BR /&gt;
Records after dedup &lt;BR /&gt;
100&lt;BR /&gt;
50&lt;BR /&gt;
20&lt;/P&gt;

&lt;P&gt;Hope you get my point &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 10:06:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338817#M62519</guid>
      <dc:creator>wessam</dc:creator>
      <dc:date>2017-06-07T10:06:03Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338818#M62520</link>
      <description>&lt;P&gt;Since you want it in two separate columns do it this way -&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your search &amp;gt; | table records | appendcols [ search &amp;lt;yoursearch&amp;gt; | dedup records | rename records as records_after_dedup ]
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 07 Jun 2017 10:23:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338818#M62520</guid>
      <dc:creator>dineshraj9</dc:creator>
      <dc:date>2017-06-07T10:23:05Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338819#M62521</link>
      <description>&lt;P&gt;unfortunately it didn't work properly&lt;BR /&gt;
index=xxx  source="yyy.csv" |table records | appendcols [ index=xxx  source="yyy.csv"  | dedup records|rename records as records_after_dedup ]&lt;/P&gt;

&lt;P&gt;it displayed all the records !&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:23:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338819#M62521</guid>
      <dc:creator>wessam</dc:creator>
      <dc:date>2020-09-29T14:23:46Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338820#M62522</link>
      <description>&lt;P&gt;can you just do something like: &lt;CODE&gt;...|eval records_after_dedup=records|stats values(records_after_dedup) as records_after_dedup list(records) as records&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 07 Jun 2017 13:49:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338820#M62522</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-06-07T13:49:35Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338821#M62523</link>
      <description>&lt;P&gt;when i write |eval records_after_dedup=records&lt;BR /&gt;
it won't copy all records , it will only add new column called "records_after_dedup" where the name records is written as below &lt;/P&gt;

&lt;P&gt;records_after_dedup&lt;BR /&gt;
records&lt;BR /&gt;
records&lt;BR /&gt;
records&lt;BR /&gt;
records&lt;BR /&gt;
...&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:24:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338821#M62523</guid>
      <dc:creator>wessam</dc:creator>
      <dc:date>2020-09-29T14:24:26Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338822#M62524</link>
      <description>&lt;P&gt;that's bizarre. try adding a single quote around records.&lt;BR /&gt;
    |eval records_after_dedup='records'&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:24:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338822#M62524</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2020-09-29T14:24:28Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338823#M62525</link>
      <description>&lt;P&gt;... | eval record_after_dedup=records | dedup record_after_dedup&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:24:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338823#M62525</guid>
      <dc:creator>szabados</dc:creator>
      <dc:date>2020-09-29T14:24:31Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338824#M62526</link>
      <description>&lt;P&gt;... | eval record_after_dedup=records | dedup record_after_dedup&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:24:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338824#M62526</guid>
      <dc:creator>szabados</dc:creator>
      <dc:date>2020-09-29T14:24:34Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338825#M62527</link>
      <description>&lt;P&gt;Thanks it works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;eval records_dedup='records'|stats values(records) as records list(records_dedup) as records_dedup| dedup records_dedup | table records_dedup,records &lt;/P&gt;

&lt;P&gt;Now it displayed two columns first one records_Dedup where records exist after removing duplicates and second column "records" where all records exist &lt;BR /&gt;
i am trying now to display both of them using chart for specific month&lt;BR /&gt;
 | chart count over "date_month" by "records,records_dedup"&lt;BR /&gt;
but now data is found &lt;span class="lia-unicode-emoji" title=":disappointed_face:"&gt;😞&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 14:24:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338825#M62527</guid>
      <dc:creator>wessam</dc:creator>
      <dc:date>2020-09-29T14:24:37Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338826#M62528</link>
      <description>&lt;P&gt;if i'm understanding, the syntax should look more like :&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;eval records_dedup='records'|stats values(records_dedup) as records_dedup list(records) as records by date_month| table date_month records_dedup records
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;&lt;CODE&gt;values&lt;/CODE&gt; lists the unique field values and &lt;CODE&gt;list&lt;/CODE&gt; lists all field values.&lt;/P&gt;

&lt;P&gt;i'm trying to understand what you're chart is supposed to look like. do you have an example?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 14:16:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338826#M62528</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-06-08T14:16:50Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338827#M62529</link>
      <description>&lt;P&gt;i would like to display a graph that represent number of records_dedup and number of records over month &lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 14:41:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338827#M62529</guid>
      <dc:creator>wessam</dc:creator>
      <dc:date>2017-06-08T14:41:02Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338828#M62530</link>
      <description>&lt;P&gt;try adding &lt;CODE&gt;|eval record_dedup_count=mvcount(records_dedup), records_count=mvcount(records)&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 14:47:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338828#M62530</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-06-08T14:47:34Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338829#M62531</link>
      <description>&lt;P&gt;it works ,much appreciated Thanks but it displayed also records_dedup and records in chart &lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 15:13:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338829#M62531</guid>
      <dc:creator>wessam</dc:creator>
      <dc:date>2017-06-08T15:13:55Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338830#M62532</link>
      <description>&lt;P&gt;if you'd like those fields removed, use &lt;CODE&gt;|fields - records_dedup records&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 15:15:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338830#M62532</guid>
      <dc:creator>cmerriman</dc:creator>
      <dc:date>2017-06-08T15:15:42Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338831#M62533</link>
      <description>&lt;P&gt;it works &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt; Thanks for your help &lt;/P&gt;</description>
      <pubDate>Thu, 08 Jun 2017 15:26:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338831#M62533</guid>
      <dc:creator>wessam</dc:creator>
      <dc:date>2017-06-08T15:26:40Z</dc:date>
    </item>
    <item>
      <title>Re: Copy Field and remove duplicate</title>
      <link>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338832#M62534</link>
      <description>&lt;P&gt;You could you mvdedup command like this (assuming  you already have multivalued field&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search giving multivalued field say 'mvfield'
| eval uniqmvfield=mvdedup(mvfield)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;More of mvdedup here&lt;BR /&gt;
&lt;A href="http://docs.splunk.com/Documentation/SplunkCloud/6.6.0/SearchReference/MultivalueEvalFunctions#mvdedup.28X.29"&gt;http://docs.splunk.com/Documentation/SplunkCloud/6.6.0/SearchReference/MultivalueEvalFunctions#mvdedup.28X.29&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;If you don't have a multivalued field already, you can do like this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your current search giving field with single value say myfield
| stats list(myfield) as all_values values(myfield) as uniq_values
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 08 Jun 2017 16:13:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Getting-Data-In/Copy-Field-and-remove-duplicate/m-p/338832#M62534</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-06-08T16:13:16Z</dc:date>
    </item>
  </channel>
</rss>

