<?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 Count an event multiple times (once per day) spanning a time range within the event in Dashboards &amp; Visualizations</title>
    <link>https://community.splunk.com/t5/Dashboards-Visualizations/Count-an-event-multiple-times-once-per-day-spanning-a-time-range/m-p/521552#M35148</link>
    <description>&lt;P&gt;I'm trying to use timechart (which may be the wrong approach) to count events for each day that were "active" over a period of time.&amp;nbsp; For example the data would be:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;&lt;STRONG&gt;user&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;&lt;STRONG&gt;session&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;&lt;STRONG&gt;first_seen&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;&lt;STRONG&gt;last_seen&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;user1&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;137271&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-13T00:39:40.079Z&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-24T00:56:30.941Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;user1&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;137264&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-13T13:17:10.052Z&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-25T13:19:37.342Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;user1&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;137272&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-13T13:48:24.513Z&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-25T13:27:27.663Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;user2&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;137272&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-16T02:45:28.436Z&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-24T13:21:27.215Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;user2&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;137267&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-18T13:03:01.847Z&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-25T13:18:05.927Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;user3&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;137272&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-13T13:04:52.235Z&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-25T13:07:02.422Z&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Resulting in (for use in some ort of timechart like graph, or maybe even a bar chart):&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;&lt;STRONG&gt;Date (x axis)&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;&lt;STRONG&gt;Count (y axis)&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-13&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-14&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-15&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-16&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-17&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;....&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-24&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-25&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One though that came to mind was creating then expanding a multivalue field with a value for each day in between the first and last dates.&amp;nbsp; Thought I'm not sure how to even accomplish that if doable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also thought a couple time basing something on a calculated duration but may be challenging given the varying first and last times.&lt;/P&gt;&lt;P&gt;Or maybe there's a precanned app out there I'm not finding?&lt;/P&gt;</description>
    <pubDate>Fri, 25 Sep 2020 20:11:40 GMT</pubDate>
    <dc:creator>mccurity</dc:creator>
    <dc:date>2020-09-25T20:11:40Z</dc:date>
    <item>
      <title>Count an event multiple times (once per day) spanning a time range within the event</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Count-an-event-multiple-times-once-per-day-spanning-a-time-range/m-p/521552#M35148</link>
      <description>&lt;P&gt;I'm trying to use timechart (which may be the wrong approach) to count events for each day that were "active" over a period of time.&amp;nbsp; For example the data would be:&lt;/P&gt;&lt;TABLE&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;&lt;STRONG&gt;user&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;&lt;STRONG&gt;session&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;&lt;STRONG&gt;first_seen&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;&lt;STRONG&gt;last_seen&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;user1&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;137271&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-13T00:39:40.079Z&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-24T00:56:30.941Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;user1&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;137264&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-13T13:17:10.052Z&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-25T13:19:37.342Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;user1&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;137272&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-13T13:48:24.513Z&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-25T13:27:27.663Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;user2&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;137272&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-16T02:45:28.436Z&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-24T13:21:27.215Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;user2&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;137267&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-18T13:03:01.847Z&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-25T13:18:05.927Z&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="53px" height="25px"&gt;user3&lt;/TD&gt;&lt;TD width="69px" height="25px"&gt;137272&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-13T13:04:52.235Z&lt;/TD&gt;&lt;TD width="214px" height="25px"&gt;2020-09-25T13:07:02.422Z&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Resulting in (for use in some ort of timechart like graph, or maybe even a bar chart):&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;TABLE border="1" width="100%"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;&lt;STRONG&gt;Date (x axis)&lt;/STRONG&gt;&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;&lt;STRONG&gt;Count (y axis)&lt;/STRONG&gt;&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-13&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-14&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-15&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-16&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-17&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;5&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;....&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;...&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-24&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;6&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD width="50%" height="25px"&gt;2020-09-25&lt;/TD&gt;&lt;TD width="50%" height="25px"&gt;4&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;One though that came to mind was creating then expanding a multivalue field with a value for each day in between the first and last dates.&amp;nbsp; Thought I'm not sure how to even accomplish that if doable.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I've also thought a couple time basing something on a calculated duration but may be challenging given the varying first and last times.&lt;/P&gt;&lt;P&gt;Or maybe there's a precanned app out there I'm not finding?&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 20:11:40 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Count-an-event-multiple-times-once-per-day-spanning-a-time-range/m-p/521552#M35148</guid>
      <dc:creator>mccurity</dc:creator>
      <dc:date>2020-09-25T20:11:40Z</dc:date>
    </item>
    <item>
      <title>Re: Count an event multiple times (once per day) spanning a time range within the event</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Count-an-event-multiple-times-once-per-day-spanning-a-time-range/m-p/521568#M35154</link>
      <description>&lt;P&gt;OK this is a bit complicated, and possibly not very efficient, but it seems to give the results you want&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;-- your search
| eval firstday=strptime(first_seen,"%Y-%m-%d")
| eval lastday=strptime(last_seen,"%Y-%m-%d")
| eval interveningdays=round((lastday-firstday)/(60*60*24))+1
| streamstats count as row 
| streamstats sum(interveningdays) as activedays
| sort - activedays
| append [|makeresults count = 1|eval activedays=1| fields - _time]
| sort activedays
| makecontinuous activedays
| sort - activedays
| streamstats min(row) as row
| streamstats values(user) as user values(session) as session values(firstday) as firstday by row
| sort activedays
| streamstats count as userday by row
| eval _time=firstday+((userday - 1)*(60*60*24))
| stats count by _time&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 25 Sep 2020 23:27:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Count-an-event-multiple-times-once-per-day-spanning-a-time-range/m-p/521568#M35154</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-09-25T23:27:12Z</dc:date>
    </item>
    <item>
      <title>Re: Count an event multiple times (once per day) spanning a time range within the event</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Count-an-event-multiple-times-once-per-day-spanning-a-time-range/m-p/524691#M35558</link>
      <description>&lt;P&gt;Thanks.&amp;nbsp; I did run into issues with having too much data; a lot of users with a lot of sessions each running for months resulting in too many results.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 17:23:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Count-an-event-multiple-times-once-per-day-spanning-a-time-range/m-p/524691#M35558</guid>
      <dc:creator>mccurity</dc:creator>
      <dc:date>2020-10-14T17:23:32Z</dc:date>
    </item>
    <item>
      <title>Re: Count an event multiple times (once per day) spanning a time range within the event</title>
      <link>https://community.splunk.com/t5/Dashboards-Visualizations/Count-an-event-multiple-times-once-per-day-spanning-a-time-range/m-p/524693#M35559</link>
      <description>&lt;P&gt;You could try creating a summary index, say once a week, and then do you main query using this index. If a session is active, will there be at least one event every day? It might make life easier if there is.&lt;/P&gt;</description>
      <pubDate>Wed, 14 Oct 2020 17:43:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Dashboards-Visualizations/Count-an-event-multiple-times-once-per-day-spanning-a-time-range/m-p/524693#M35559</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2020-10-14T17:43:35Z</dc:date>
    </item>
  </channel>
</rss>

