<?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 of event with duration in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-of-event-with-duration/m-p/145680#M40638</link>
    <description>&lt;P&gt;For this kind of questions there is no need of sampling every second. &lt;/P&gt;

&lt;P&gt;If you want to measure the concurrency of elements with a duration you should do:&lt;BR /&gt;
* Align the buckets to a periods that you like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval bucket_time_size=1800
|eval start_bucket_time=START_TIME-(START_TIME%bucket_time_size)
|eval end_bucket_time=END_TIME-(END_TIME%bucket_time_size)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Create the ranges in a variable of the events for the bucket size you defined&lt;/P&gt;

&lt;P&gt;|eval bucket_start=mvrange(start_bucket_time,end_bucket_time,bucket_time_size)&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Expand the variable (and the events)&lt;/P&gt;

&lt;P&gt;|mvexpand bucket_start&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Assign the _time to the new expanded field.&lt;/P&gt;

&lt;P&gt;|eval _time=bucket_start&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;With that you will have what are the concurrent elements in a certain frame of time. Calculating how much is really used in each bucket will be like the calculation of in the previous answer of duration_bucket.&lt;/P&gt;

&lt;P&gt;More detail explanation in: &lt;A href="http://answers.splunk.com/answers/223129/how-to-distribute-an-event-among-many-time-buckets.html" target="_blank"&gt;http://answers.splunk.com/answers/223129/how-to-distribute-an-event-among-many-time-buckets.html&lt;/A&gt; &lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 19:19:48 GMT</pubDate>
    <dc:creator>nadid</dc:creator>
    <dc:date>2020-09-28T19:19:48Z</dc:date>
    <item>
      <title>Timechart of event with duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-of-event-with-duration/m-p/145677#M40635</link>
      <description>&lt;P&gt;I try make nice timechart how many objects are unavailable in specific time.&lt;BR /&gt;
In my log I have start and end events from every outages and they are binded nicely together. Also I have calculated how long these outages are (in minute accuracy). &lt;BR /&gt;
When I try to drad timechart with :&lt;BR /&gt;
&lt;PRE&gt;&lt;BR /&gt;
 index=alarms event=add OR event=clear&lt;BR /&gt;
 | transaction event_id startswith=(event=add) endswith=(event =="Clear") keepevicted=true&lt;BR /&gt;
 | timechart dc(event_id)&lt;BR /&gt;
&lt;/PRE&gt;&lt;BR /&gt;
I've got line stay up whole day. If I add span=15min (the accuracy what I want), I got only small spikes(15min), even those outages are 4 or 5 hours long.&lt;/P&gt;

&lt;P&gt;Analog:&lt;BR /&gt;
 Restaurant have log on every seat when customer sit down and stands up. Every customer uses different time when they are eating. I want know how many customer we have in specific 15min timewindow in graph.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 15:51:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-of-event-with-duration/m-p/145677#M40635</guid>
      <dc:creator>Wam79</dc:creator>
      <dc:date>2020-09-28T15:51:36Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart of event with duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-of-event-with-duration/m-p/145678#M40636</link>
      <description>&lt;P&gt;Whenever I see questions about keeping track of state like this I immediately think of this excellent blog post covering the subject: &lt;A href="http://blogs.splunk.com/2011/01/11/maintaining-state-of-the-union/"&gt;http://blogs.splunk.com/2011/01/11/maintaining-state-of-the-union/&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2014 10:46:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-of-event-with-duration/m-p/145678#M40636</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2014-02-11T10:46:20Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart of event with duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-of-event-with-duration/m-p/145679#M40637</link>
      <description>&lt;P&gt;Well what I understand of that blog was "you should check status of your monitored item every second, if you want good occupacy report".  I can't agree more that it is most reliable way to do that. I am not sure how vice it is when I have 1000+ items to look after.&lt;/P&gt;</description>
      <pubDate>Tue, 11 Feb 2014 11:20:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-of-event-with-duration/m-p/145679#M40637</guid>
      <dc:creator>Wam79</dc:creator>
      <dc:date>2014-02-11T11:20:07Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart of event with duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-of-event-with-duration/m-p/145680#M40638</link>
      <description>&lt;P&gt;For this kind of questions there is no need of sampling every second. &lt;/P&gt;

&lt;P&gt;If you want to measure the concurrency of elements with a duration you should do:&lt;BR /&gt;
* Align the buckets to a periods that you like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;|eval bucket_time_size=1800
|eval start_bucket_time=START_TIME-(START_TIME%bucket_time_size)
|eval end_bucket_time=END_TIME-(END_TIME%bucket_time_size)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;UL&gt;
&lt;LI&gt;&lt;P&gt;Create the ranges in a variable of the events for the bucket size you defined&lt;/P&gt;

&lt;P&gt;|eval bucket_start=mvrange(start_bucket_time,end_bucket_time,bucket_time_size)&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Expand the variable (and the events)&lt;/P&gt;

&lt;P&gt;|mvexpand bucket_start&lt;/P&gt;&lt;/LI&gt;
&lt;LI&gt;&lt;P&gt;Assign the _time to the new expanded field.&lt;/P&gt;

&lt;P&gt;|eval _time=bucket_start&lt;/P&gt;&lt;/LI&gt;
&lt;/UL&gt;

&lt;P&gt;With that you will have what are the concurrent elements in a certain frame of time. Calculating how much is really used in each bucket will be like the calculation of in the previous answer of duration_bucket.&lt;/P&gt;

&lt;P&gt;More detail explanation in: &lt;A href="http://answers.splunk.com/answers/223129/how-to-distribute-an-event-among-many-time-buckets.html" target="_blank"&gt;http://answers.splunk.com/answers/223129/how-to-distribute-an-event-among-many-time-buckets.html&lt;/A&gt; &lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:19:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-of-event-with-duration/m-p/145680#M40638</guid>
      <dc:creator>nadid</dc:creator>
      <dc:date>2020-09-28T19:19:48Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart of event with duration</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-of-event-with-duration/m-p/145681#M40639</link>
      <description>&lt;P&gt;@warm79 , does it solves this to you?&lt;/P&gt;</description>
      <pubDate>Sat, 28 Mar 2015 14:49:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-of-event-with-duration/m-p/145681#M40639</guid>
      <dc:creator>nadid</dc:creator>
      <dc:date>2015-03-28T14:49:30Z</dc:date>
    </item>
  </channel>
</rss>

