<?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 do I dedup duplicate values including that value itself? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-dedup-duplicate-values-including-that-value-itself/m-p/615622#M213936</link>
    <description>&lt;P&gt;Thanks for the reply. I wanted to have the timestamp of the occurrence as well. I went to do more research and apparently I can add this:&lt;/P&gt;&lt;PRE&gt;| stats count as count, earliest(_time) by&amp;nbsp;username&amp;nbsp;|&amp;nbsp;where&amp;nbsp;count=1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 03 Oct 2022 09:50:10 GMT</pubDate>
    <dc:creator>charlottelimcl</dc:creator>
    <dc:date>2022-10-03T09:50:10Z</dc:date>
    <item>
      <title>How do I dedup duplicate values including that value itself?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-dedup-duplicate-values-including-that-value-itself/m-p/615619#M213934</link>
      <description>&lt;P&gt;Hi everyone, I am new to splunk. I am looking at windows event logs for the EventCode=4725 for all usernames within a week's timeframe. What I want is to remove username results if there are more than 1 count for this eventcode including that username, and then list in a table to show the timestamp and username when the eventcode occurred.&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Example:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Usernames with EventCode=4725 recorded within 1 week:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Day 1 10pm : anna&lt;/P&gt;&lt;P&gt;Day 1 11pm : betty&lt;/P&gt;&lt;P&gt;Day 3 10pm : anna&lt;/P&gt;&lt;P&gt;Day 3 1pm :&amp;nbsp; charlie&lt;/P&gt;&lt;P&gt;Day 7 2pm : zach&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;STRONG&gt;Final result I want is:&lt;/STRONG&gt;&lt;/P&gt;&lt;P&gt;Day 1 11pm : betty&lt;/P&gt;&lt;P&gt;Day 3 1pm :&amp;nbsp; charlie&lt;/P&gt;&lt;P&gt;Day 7 2pm : zach&lt;/P&gt;&lt;P&gt;From the above we have 'anna' removed completely from as her event showed up more than once.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;This is my original query:&lt;/P&gt;&lt;PRE&gt;index=wineventlog EventCode=4725&lt;BR /&gt;| fields *&lt;BR /&gt;| eval timestamp=strftime(_time, "%Y-%m-%dT%H:%M"%S")&lt;BR /&gt;| stats count by username | where username = 1&lt;/PRE&gt;&lt;P&gt;I then realised the problem with using stats count by,&amp;nbsp; because I wouldnt be able to show the timestamp for the results result this is in statistics.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I have thought of using dedup to remove duplicate values, but I have not found a way to remove duplicate values including that value itself.&lt;/P&gt;&lt;P&gt;Please help. Thank you&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 09:14:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-dedup-duplicate-values-including-that-value-itself/m-p/615619#M213934</guid>
      <dc:creator>charlottelimcl</dc:creator>
      <dc:date>2022-10-03T09:14:19Z</dc:date>
    </item>
    <item>
      <title>Re: How do I dedup duplicate values including that value itself?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-dedup-duplicate-values-including-that-value-itself/m-p/615620#M213935</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250014"&gt;@charlottelimcl&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;let me understand:&lt;/P&gt;&lt;P&gt;you want to display only usernames that are only one time in your events, is this corret?&lt;/P&gt;&lt;P&gt;if this is your need, please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=wineventlog EventCode=4725
| stats count BY username
| where count=1&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 09:26:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-dedup-duplicate-values-including-that-value-itself/m-p/615620#M213935</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-03T09:26:06Z</dc:date>
    </item>
    <item>
      <title>Re: How do I dedup duplicate values including that value itself?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-dedup-duplicate-values-including-that-value-itself/m-p/615622#M213936</link>
      <description>&lt;P&gt;Thanks for the reply. I wanted to have the timestamp of the occurrence as well. I went to do more research and apparently I can add this:&lt;/P&gt;&lt;PRE&gt;| stats count as count, earliest(_time) by&amp;nbsp;username&amp;nbsp;|&amp;nbsp;where&amp;nbsp;count=1&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 09:50:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-dedup-duplicate-values-including-that-value-itself/m-p/615622#M213936</guid>
      <dc:creator>charlottelimcl</dc:creator>
      <dc:date>2022-10-03T09:50:10Z</dc:date>
    </item>
    <item>
      <title>Re: How do I dedup duplicate values including that value itself?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-do-I-dedup-duplicate-values-including-that-value-itself/m-p/615623#M213937</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/250014"&gt;@charlottelimcl&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;yes, it's correct.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index=wineventlog EventCode=4725
| stats count earliest(_time) AS timestamp BY username
| where count=1
| eval timestamp=strftime(timestamp,"%Y-%m-%dT%H:%M"%S")&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 03 Oct 2022 09:55:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-do-I-dedup-duplicate-values-including-that-value-itself/m-p/615623#M213937</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-10-03T09:55:59Z</dc:date>
    </item>
  </channel>
</rss>

