<?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 make a Search NOT append results from previous row if record already exists ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584934#M203767</link>
    <description>&lt;P&gt;Thank you very much.&amp;nbsp; Can you pls explain what does&lt;BR /&gt;&amp;nbsp;eval identity=mvindex(split(identity,"|"),0)+"|"+email+"|"+legacyUsername&amp;nbsp; &amp;nbsp;do ?&lt;BR /&gt;&lt;BR /&gt;I did lookup online on mvindex command but what exactly made you suggest&amp;nbsp;split(identity,"|"),0) ?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
    <pubDate>Mon, 14 Feb 2022 08:28:49 GMT</pubDate>
    <dc:creator>neerajs_81</dc:creator>
    <dc:date>2022-02-14T08:28:49Z</dc:date>
    <item>
      <title>How to make a Search NOT append results from previous row if record already exists ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584912#M203757</link>
      <description>&lt;P&gt;Hi All,&lt;BR /&gt;&lt;BR /&gt;We have a saved search (snippet below) which populates a CSV lookup file.&amp;nbsp; The search is scheduled to run daily.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xyz
...
| stats latest(_time) as _time, latest(legacyUsername), latest(title), latest(email), latest(endDate), latest(firstname), latest(lastname),  by identity
| rename latest(*) as *
| eval identity = identity+"|"+email+"|"+legacyUsername&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;What's happening is,&amp;nbsp; every time the search&amp;nbsp; runs it creates duplicates as in each subsequent row appends the&amp;nbsp; results from the previous row to it for the "&lt;STRONG&gt;Identity&lt;/STRONG&gt;" column as shown below.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;I get that my "&lt;STRONG&gt;eval identity&lt;/STRONG&gt;" command is making it do it.&amp;nbsp; But how can i make it not create new records if the "identity" already exists once in the table?&amp;nbsp; &amp;nbsp;Hope i am clear.&amp;nbsp; &amp;nbsp;I tried "Dedup identity" that didn't work.&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&amp;nbsp;Result:&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1" width="100.00000000000001%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="26.731182795698928%" height="25px"&gt;&lt;STRONG&gt;Identity&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="6.60215053763441%" height="25px"&gt;time&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;legacyuserName&lt;/TD&gt;&lt;TD width="12.408602150537636%" height="25px"&gt;title&lt;/TD&gt;&lt;TD width="13.827956989247314%" height="25px"&gt;email&lt;/TD&gt;&lt;TD width="11.263440860215054%" height="25px"&gt;enddata&lt;/TD&gt;&lt;TD width="4.166666666666667%" height="25px"&gt;first&lt;/TD&gt;&lt;TD width="8.333333333333334%" height="25px"&gt;lastname&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="26.731182795698928%" height="25px"&gt;&lt;SPAN&gt;1001|karen.woo@xyz.com|karen_woo&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="6.60215053763441%" height="25px"&gt;xx&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;xxxx&lt;/TD&gt;&lt;TD width="12.408602150537636%" height="25px"&gt;xxx&lt;/TD&gt;&lt;TD width="13.827956989247314%" height="25px"&gt;xxx&lt;/TD&gt;&lt;TD width="11.263440860215054%" height="25px"&gt;xx&lt;/TD&gt;&lt;TD width="4.166666666666667%" height="25px"&gt;Karen&lt;/TD&gt;&lt;TD width="8.333333333333334%" height="25px"&gt;Woo&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="26.731182795698928%" height="25px"&gt;&lt;SPAN&gt;1001|karen.woo@xyz.com|karen_woo&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;|karen.woo@xyz.com|karen_woo&lt;/SPAN&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="6.60215053763441%" height="25px"&gt;xx&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;xxxx&lt;/TD&gt;&lt;TD width="12.408602150537636%" height="25px"&gt;xxx&lt;/TD&gt;&lt;TD width="13.827956989247314%" height="25px"&gt;xxx&lt;/TD&gt;&lt;TD width="11.263440860215054%" height="25px"&gt;xx&lt;/TD&gt;&lt;TD width="4.166666666666667%" height="25px"&gt;Karen&lt;/TD&gt;&lt;TD width="8.333333333333334%" height="25px"&gt;Woo&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="26.731182795698928%" height="25px"&gt;&lt;SPAN&gt;1001|karen.woo@xyz.com|karen_woo&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;|karen.woo@xyz.com|karen_woo&lt;/SPAN&gt;&amp;nbsp;&lt;SPAN&gt;|karen.woo@xyz.com|karen_woo&lt;/SPAN&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="6.60215053763441%" height="25px"&gt;xx&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;xxxx&lt;/TD&gt;&lt;TD width="12.408602150537636%" height="25px"&gt;xxx&lt;/TD&gt;&lt;TD width="13.827956989247314%" height="25px"&gt;xxx&lt;/TD&gt;&lt;TD width="11.263440860215054%" height="25px"&gt;xx&lt;/TD&gt;&lt;TD width="4.166666666666667%" height="25px"&gt;Karen&lt;/TD&gt;&lt;TD width="8.333333333333334%" height="25px"&gt;Woo&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="26.731182795698928%" height="25px"&gt;&lt;SPAN&gt;1001|karen.woo@xyz.com|karen_woo|karen.woo@xyz.com|karen_woo&amp;nbsp;|karen.woo@xyz.com|karen_woo|karen.woo@xyz.com|karen_woo&amp;nbsp;|karen.woo@xyz.com|karen_woo&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="6.60215053763441%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="12.408602150537636%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="13.827956989247314%" height="25px"&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="11.263440860215054%" height="25px"&gt;xx&lt;/TD&gt;&lt;TD width="4.166666666666667%" height="25px"&gt;Karen&lt;/TD&gt;&lt;TD width="8.333333333333334%" height="25px"&gt;Woo&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 14 Feb 2022 07:17:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584912#M203757</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2022-02-14T07:17:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a Search NOT append results from previous row if record already exists ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584913#M203758</link>
      <description>&lt;P&gt;Adding&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;.&lt;BR /&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 07:19:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584913#M203758</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2022-02-14T07:19:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a Search NOT append results from previous row if record already exists ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584915#M203760</link>
      <description>Can you just check if identity in not null/“” (empty) and then add those to it?</description>
      <pubDate>Mon, 14 Feb 2022 07:24:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584915#M203760</guid>
      <dc:creator>isoutamo</dc:creator>
      <dc:date>2022-02-14T07:24:27Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a Search NOT append results from previous row if record already exists ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584916#M203761</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/229059"&gt;@neerajs_81&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;the only thing I can suppose is that you have more values in the latest fields, so try to use also email and legacyUsername as key in the BY cluase, something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xyz
...
| stats 
   latest(_time) as _time
   latest(title) AS title
   latest(endDate) AS endDate
   latest(firstname) AS firstname
   latest(lastname) AS lastname
   by identity email legacyUsername
| eval identity = identity."|".email."|".legacyUsername&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 07:24:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584916#M203761</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-02-14T07:24:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a Search NOT append results from previous row if record already exists ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584917#M203762</link>
      <description>&lt;LI-CODE lang="markup"&gt;| eval identity=mvindex(split(identity,"|"),0)+"|"+email+"|"+legacyUsername&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 14 Feb 2022 07:27:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584917#M203762</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-02-14T07:27:35Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a Search NOT append results from previous row if record already exists ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584919#M203763</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp; &amp;nbsp;Tried that,&amp;nbsp; it appears to have stop appending to previous record&amp;nbsp; but the result is still showing duplicates as follows:&amp;nbsp; Basically it resolved the appending piece but is still creating a new record for the same Identity even though the identity exists.&amp;nbsp; How to make it not create duplicates further?&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1" width="100.00000000000001%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="26.731182795698928%" height="25px"&gt;&lt;STRONG&gt;Identity&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="6.60215053763441%" height="25px"&gt;time&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;legacyuserName&lt;/TD&gt;&lt;TD width="12.408602150537636%" height="25px"&gt;title&lt;/TD&gt;&lt;TD width="13.827956989247314%" height="25px"&gt;email&lt;/TD&gt;&lt;TD width="11.263440860215054%" height="25px"&gt;enddata&lt;/TD&gt;&lt;TD width="4.166666666666667%" height="25px"&gt;first&lt;/TD&gt;&lt;TD width="8.333333333333334%" height="25px"&gt;lastname&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="26.731182795698928%" height="25px"&gt;&lt;SPAN&gt;1001|karen.woo@xyz.com|karen_woo&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="6.60215053763441%" height="25px"&gt;xx&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;xxxx&lt;/TD&gt;&lt;TD width="12.408602150537636%" height="25px"&gt;xxx&lt;/TD&gt;&lt;TD width="13.827956989247314%" height="25px"&gt;xxx&lt;/TD&gt;&lt;TD width="11.263440860215054%" height="25px"&gt;xx&lt;/TD&gt;&lt;TD width="4.166666666666667%" height="25px"&gt;Karen&lt;/TD&gt;&lt;TD width="8.333333333333334%" height="25px"&gt;Woo&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="26.731182795698928%" height="25px"&gt;&lt;SPAN&gt;1001|karen.woo@xyz.com|karen_woo&lt;/SPAN&gt;&amp;nbsp;&lt;/TD&gt;&lt;TD width="6.60215053763441%" height="25px"&gt;xx&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;xxxx&lt;/TD&gt;&lt;TD width="12.408602150537636%" height="25px"&gt;xxx&lt;/TD&gt;&lt;TD width="13.827956989247314%" height="25px"&gt;xxx&lt;/TD&gt;&lt;TD width="11.263440860215054%" height="25px"&gt;xx&lt;/TD&gt;&lt;TD width="4.166666666666667%" height="25px"&gt;Karen&lt;/TD&gt;&lt;TD width="8.333333333333334%" height="25px"&gt;Woo&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="26.731182795698928%" height="25px"&gt;&lt;SPAN&gt;1001|karen.woo@xyz.com|karen_woo&lt;/SPAN&gt;&lt;/TD&gt;&lt;TD width="6.60215053763441%" height="25px"&gt;xx&lt;/TD&gt;&lt;TD width="16.666666666666668%" height="25px"&gt;xxxx&lt;/TD&gt;&lt;TD width="12.408602150537636%" height="25px"&gt;xxx&lt;/TD&gt;&lt;TD width="13.827956989247314%" height="25px"&gt;xxx&lt;/TD&gt;&lt;TD width="11.263440860215054%" height="25px"&gt;xx&lt;/TD&gt;&lt;TD width="4.166666666666667%" height="25px"&gt;Karen&lt;/TD&gt;&lt;TD width="8.333333333333334%" height="25px"&gt;Woo&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Mon, 14 Feb 2022 07:35:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584919#M203763</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2022-02-14T07:35:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a Search NOT append results from previous row if record already exists ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584922#M203765</link>
      <description>&lt;P&gt;The issue is that you are regenerating the 1001|karen.woo@xyz.com from the original as well as the previously generated version, so try repeating the stats and rename to remove the duplicate&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=xyz
...
| stats latest(_time) as _time, latest(legacyUsername), latest(title), latest(email), latest(endDate), latest(firstname), latest(lastname),  by identity
| rename latest(*) as *
| eval identity=mvindex(split(identity,"|"),0)+"|"+email+"|"+legacyUsername
| stats latest(_time) as _time, latest(legacyUsername), latest(title), latest(email), latest(endDate), latest(firstname), latest(lastname),  by identity
| rename latest(*) as *&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 14 Feb 2022 07:50:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584922#M203765</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-02-14T07:50:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a Search NOT append results from previous row if record already exists ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584924#M203766</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/161352"&gt;@gcusello&lt;/a&gt;&amp;nbsp;,&amp;nbsp; Thank you for responding. Tried what you suggested in the stats by clause,&amp;nbsp; but it didn't make any difference to the results.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 07:53:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584924#M203766</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2022-02-14T07:53:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a Search NOT append results from previous row if record already exists ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584934#M203767</link>
      <description>&lt;P&gt;Thank you very much.&amp;nbsp; Can you pls explain what does&lt;BR /&gt;&amp;nbsp;eval identity=mvindex(split(identity,"|"),0)+"|"+email+"|"+legacyUsername&amp;nbsp; &amp;nbsp;do ?&lt;BR /&gt;&lt;BR /&gt;I did lookup online on mvindex command but what exactly made you suggest&amp;nbsp;split(identity,"|"),0) ?&amp;nbsp;&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 08:28:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584934#M203767</guid>
      <dc:creator>neerajs_81</dc:creator>
      <dc:date>2022-02-14T08:28:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to make a Search NOT append results from previous row if record already exists ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584938#M203769</link>
      <description>&lt;P&gt;split breaks the string up using the delimiter "|" into a multi-value field, mvindex takes one of the values, in this case, the first one since indexing begins at zero for this function. So, specifically, mvindex(split("1001|karen.woo@xyz.com|karen_woo","|"),0) equates to "1001". The line then appends the email and legacyUsername back again to recreate the identity.&lt;/P&gt;</description>
      <pubDate>Mon, 14 Feb 2022 08:48:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-a-Search-NOT-append-results-from-previous-row-if/m-p/584938#M203769</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-02-14T08:48:28Z</dc:date>
    </item>
  </channel>
</rss>

