<?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 How to timechart the count of assets per month based on a range between two dates for each asset? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-the-count-of-assets-per-month-based-on-a-range/m-p/229782#M68070</link>
    <description>&lt;P&gt;In my data, I have a list of assets that occur with a "First Found" date as well as a "Last Found" date.  I need to generate a timechart so that each asset is counted for the months that they are "active" (eg anything between the first/last found dates).  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;asset  first_found  last_found
Host1  01/01/2016   05/01/2016
Host2  03/15/2016   04/01/2016
Host3  02/10/2016   05/01/2016
Host4  05/01/2016   06/26/2016
Host5  03/01/2016  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I'm looking for using the sample data above is a timechart count by month of each asset that occurred during that month. For January, the count would be 1 (Host1), February would be 2 (Host1, Host2), March would be 4 (Host1, Host2, Host3, Host5), etc.  Some events will not have the last_found date which means they are still active and should be counted up to and including the current month. Any help would be appreciated.  &lt;/P&gt;</description>
    <pubDate>Mon, 27 Jun 2016 18:24:23 GMT</pubDate>
    <dc:creator>john_dagostino</dc:creator>
    <dc:date>2016-06-27T18:24:23Z</dc:date>
    <item>
      <title>How to timechart the count of assets per month based on a range between two dates for each asset?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-the-count-of-assets-per-month-based-on-a-range/m-p/229782#M68070</link>
      <description>&lt;P&gt;In my data, I have a list of assets that occur with a "First Found" date as well as a "Last Found" date.  I need to generate a timechart so that each asset is counted for the months that they are "active" (eg anything between the first/last found dates).  &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;asset  first_found  last_found
Host1  01/01/2016   05/01/2016
Host2  03/15/2016   04/01/2016
Host3  02/10/2016   05/01/2016
Host4  05/01/2016   06/26/2016
Host5  03/01/2016  
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I'm looking for using the sample data above is a timechart count by month of each asset that occurred during that month. For January, the count would be 1 (Host1), February would be 2 (Host1, Host2), March would be 4 (Host1, Host2, Host3, Host5), etc.  Some events will not have the last_found date which means they are still active and should be counted up to and including the current month. Any help would be appreciated.  &lt;/P&gt;</description>
      <pubDate>Mon, 27 Jun 2016 18:24:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-the-count-of-assets-per-month-based-on-a-range/m-p/229782#M68070</guid>
      <dc:creator>john_dagostino</dc:creator>
      <dc:date>2016-06-27T18:24:23Z</dc:date>
    </item>
    <item>
      <title>Re: How to timechart the count of assets per month based on a range between two dates for each asset?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-the-count-of-assets-per-month-based-on-a-range/m-p/229783#M68071</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your base search 
| eval first_found=strptime(first_found, "%m/%d/%Y")  
| eval last_found=strptime(last_found, "%m/%d/%Y") 
| eval last_found=if(isnull(last_found), now(), last_found) 
| eval range=mvrange(first_found, last_found, "1mon") 
| mvexpand range 
| eval range=strftime(range, "%m-%b") 
| chart count over range by asset 
| addtotals
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 27 Jun 2016 23:22:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-the-count-of-assets-per-month-based-on-a-range/m-p/229783#M68071</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-06-27T23:22:00Z</dc:date>
    </item>
    <item>
      <title>Re: How to timechart the count of assets per month based on a range between two dates for each asset?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-the-count-of-assets-per-month-based-on-a-range/m-p/229784#M68072</link>
      <description>&lt;P&gt;Thank you, I was able to get a modified version of this to work.&lt;/P&gt;</description>
      <pubDate>Tue, 28 Jun 2016 16:44:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-timechart-the-count-of-assets-per-month-based-on-a-range/m-p/229784#M68072</guid>
      <dc:creator>john_dagostino</dc:creator>
      <dc:date>2016-06-28T16:44:11Z</dc:date>
    </item>
  </channel>
</rss>

