<?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 Using dedup in multi-month query in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-dedup-in-multi-month-query/m-p/476270#M133764</link>
    <description>&lt;P&gt;I'm trying to create a timechart showing the count of events over 6 months. The query is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=itemdb `macrotest` (name != "*itemA" AND name != "*itemB") | eval category = case(...) | eval fields = split(name,"_") | eval mname = mvindex(fields,1) | search category = "promo" | dedup f_1 f_2 | timechart count by id span=1mon
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The goal is to &lt;CODE&gt;dedup&lt;/CODE&gt; within that month only, not across all 6 months. For example, if the same values of &lt;CODE&gt;f_1,f_2&lt;/CODE&gt; appear in all 6 months, I should get 1 count of &lt;CODE&gt;f_1,f_2&lt;/CODE&gt; in each of the 6 months, not only in the last month. However, it seems like the &lt;CODE&gt;f_1,f_2&lt;/CODE&gt; values will be &lt;CODE&gt;dedup&lt;/CODE&gt; across all 6 months, and appear only in the last month.&lt;/P&gt;

&lt;P&gt;Can I bin events by the months they appear in, then dedup within that month only to achieve this? Or is there another way?&lt;/P&gt;</description>
    <pubDate>Wed, 19 Feb 2020 08:04:14 GMT</pubDate>
    <dc:creator>wu_weidong</dc:creator>
    <dc:date>2020-02-19T08:04:14Z</dc:date>
    <item>
      <title>Using dedup in multi-month query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-dedup-in-multi-month-query/m-p/476270#M133764</link>
      <description>&lt;P&gt;I'm trying to create a timechart showing the count of events over 6 months. The query is &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=itemdb `macrotest` (name != "*itemA" AND name != "*itemB") | eval category = case(...) | eval fields = split(name,"_") | eval mname = mvindex(fields,1) | search category = "promo" | dedup f_1 f_2 | timechart count by id span=1mon
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The goal is to &lt;CODE&gt;dedup&lt;/CODE&gt; within that month only, not across all 6 months. For example, if the same values of &lt;CODE&gt;f_1,f_2&lt;/CODE&gt; appear in all 6 months, I should get 1 count of &lt;CODE&gt;f_1,f_2&lt;/CODE&gt; in each of the 6 months, not only in the last month. However, it seems like the &lt;CODE&gt;f_1,f_2&lt;/CODE&gt; values will be &lt;CODE&gt;dedup&lt;/CODE&gt; across all 6 months, and appear only in the last month.&lt;/P&gt;

&lt;P&gt;Can I bin events by the months they appear in, then dedup within that month only to achieve this? Or is there another way?&lt;/P&gt;</description>
      <pubDate>Wed, 19 Feb 2020 08:04:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-dedup-in-multi-month-query/m-p/476270#M133764</guid>
      <dc:creator>wu_weidong</dc:creator>
      <dc:date>2020-02-19T08:04:14Z</dc:date>
    </item>
    <item>
      <title>Re: Using dedup in multi-month query</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-dedup-in-multi-month-query/m-p/476271#M133765</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=itemdb `macrotest` (name != "*itemA" AND name != "*itemB") 
| eval category = case(...) 
| eval fields = split(name,"_") 
| eval mname = mvindex(fields,1) 
| search category = "promo" 
| eval f_1_tmp=f_1.":".strftime(_time,"%Y%m"),f_2_tmp=f_2.":".strftime(_time,"%Y%m")
| dedup f_1_tmp f_2_tmp 
| timechart count by id span=1mon
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 29 Feb 2020 00:44:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-dedup-in-multi-month-query/m-p/476271#M133765</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-02-29T00:44:05Z</dc:date>
    </item>
  </channel>
</rss>

