<?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: Timechart  with dedup of 2 fields in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473195#M133180</link>
    <description>&lt;P&gt;Not this answer @to4kawa, but the answer you gave earlier worked. it seems you changed it to addtotals.&lt;/P&gt;</description>
    <pubDate>Thu, 16 Apr 2020 11:31:46 GMT</pubDate>
    <dc:creator>utk123</dc:creator>
    <dc:date>2020-04-16T11:31:46Z</dc:date>
    <item>
      <title>Timechart  with dedup of 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473187#M133172</link>
      <description>&lt;P&gt;For my logs with IP and Vulnerability ID (VID), I have few duplicate values. Which I can easily remove with "&lt;STRONG&gt;dedup IP, VID&lt;/STRONG&gt;". As this will only show single value in logs for an IP+VID combination. &lt;/P&gt;

&lt;P&gt;But with timechart over 1 month it doesn't work, as if I dedup before timechart, it removes duplicate values and doesn't show exact results for every week. &lt;/P&gt;

&lt;P&gt;I need dedup to run for every week separately under timechart to give correct results. &lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Currently running:&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;&lt;EM&gt;My main search.... | dedup IP, VID | timechart span=w@1w count&lt;/EM&gt;&lt;/P&gt;

&lt;P&gt;Results what I get with incorrect count:&lt;BR /&gt;
    &lt;STRONG&gt;_time **                                   **  count&lt;/STRONG&gt;&lt;BR /&gt;
    2020-03-17                            2224&lt;BR /&gt;
    2020-03-17                            218&lt;BR /&gt;
    2020-03-17                            689&lt;BR /&gt;
    2020-03-17                            1432&lt;BR /&gt;
    2020-03-17                            666&lt;/P&gt;

&lt;P&gt;But actually if "&lt;STRONG&gt;dedup IP, VID&lt;/STRONG&gt;" works separately for each week, then each week's result should be around 2000.&lt;/P&gt;

&lt;P&gt;Thanks in advance. &lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 09:12:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473187#M133172</guid>
      <dc:creator>utk123</dc:creator>
      <dc:date>2020-04-16T09:12:23Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart  with dedup of 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473188#M133173</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;| makeresults count=20
| fillnull IP
| eval IP = 1
| accum IP as VID
| dedup IP VID
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this is sample. try this and &lt;CODE&gt;|dedup IP | dedup VID&lt;/CODE&gt;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your main search | bin _time span=w@1w  | stats dc(IP) as IP dc(VID) as VID by _time | addtotals
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;How about this?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 09:23:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473188#M133173</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-16T09:23:07Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart  with dedup of 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473189#M133174</link>
      <description>&lt;P&gt;First answer with makeresults doesn't give any results. &lt;/P&gt;

&lt;P&gt;Second answer's logic I understand, but it doesn't seem to remove the duplicate values for IP and VID. &lt;BR /&gt;
Maybe if you can help to modify second answer to remove duplicate values, it would work. I have tried few changes to your second answer, but no luck. &lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 10:15:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473189#M133174</guid>
      <dc:creator>utk123</dc:creator>
      <dc:date>2020-04-16T10:15:57Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart  with dedup of 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473190#M133175</link>
      <description>&lt;P&gt;&lt;CODE&gt;First answer with makeresults doesn't give any results.&lt;/CODE&gt;&lt;BR /&gt;
my result:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;IP  VID _time
1   1   2020/04/16 19:18:03
1   2   2020/04/16 19:18:03
1   3   2020/04/16 19:18:03
1   4   2020/04/16 19:18:03
1   5   2020/04/16 19:18:03
....
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 16 Apr 2020 10:22:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473190#M133175</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-16T10:22:42Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart  with dedup of 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473191#M133176</link>
      <description>&lt;P&gt;Are you saying that you want to look at each week in isolation, dedup the IP and VIP in that week's group of events? If so, then try adding a "weekbreaker" field and deduping that before your timechart:&lt;BR /&gt;
&lt;CODE&gt;| eval weekbreaker=relative_time(_time, "@w") | dedup IP,VIP,weekbreaker&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 11:02:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473191#M133176</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2020-04-16T11:02:50Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart  with dedup of 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473192#M133177</link>
      <description>&lt;P&gt;It works if I just change the sequence of _time in bin command.&lt;/P&gt;

&lt;P&gt;main search...&lt;BR /&gt;
| bin span=w@1w _time&lt;BR /&gt;
| stats count by IP VID _time&lt;BR /&gt;
| stats count by _time&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 11:23:27 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473192#M133177</guid>
      <dc:creator>utk123</dc:creator>
      <dc:date>2020-04-16T11:23:27Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart  with dedup of 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473193#M133178</link>
      <description>&lt;P&gt;tried it, but it just shows Events, and no Statistics or Visualization to check results. &lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 11:27:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473193#M133178</guid>
      <dc:creator>utk123</dc:creator>
      <dc:date>2020-04-16T11:27:23Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart  with dedup of 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473194#M133179</link>
      <description>&lt;P&gt;Below answer works. Thanks to @to4kawa for helping.&lt;/P&gt;

&lt;P&gt;main search...&lt;BR /&gt;
| bin span=w@1w _time&lt;BR /&gt;
| stats count by IP VID _time&lt;BR /&gt;
| stats count by _time&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 11:29:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473194#M133179</guid>
      <dc:creator>utk123</dc:creator>
      <dc:date>2020-04-16T11:29:45Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart  with dedup of 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473195#M133180</link>
      <description>&lt;P&gt;Not this answer @to4kawa, but the answer you gave earlier worked. it seems you changed it to addtotals.&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 11:31:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473195#M133180</guid>
      <dc:creator>utk123</dc:creator>
      <dc:date>2020-04-16T11:31:46Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart  with dedup of 2 fields</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473196#M133181</link>
      <description>&lt;P&gt;first &lt;CODE&gt;but it doesn't seem to remove the duplicate values for IP and VID.&lt;/CODE&gt;&lt;BR /&gt;
so, I amended.&lt;BR /&gt;
second &lt;CODE&gt;the answer you gave earlier worked.&lt;/CODE&gt;&lt;BR /&gt;
Isn't it terrible?&lt;/P&gt;</description>
      <pubDate>Thu, 16 Apr 2020 11:44:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-with-dedup-of-2-fields/m-p/473196#M133181</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-16T11:44:41Z</dc:date>
    </item>
  </channel>
</rss>

