<?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: Visualize ongoing actions based on start/stop time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619844#M215428</link>
    <description>&lt;P&gt;Please share your search - it sounds like you may have changed _time before determining the event type&lt;/P&gt;&lt;P&gt;Alternatively, you could do it this way&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;``` Duplicate events ```
| eval event=mvrange(1,3)
| mvexpand event
``` Reset event time ```
| eval _time=if(event=1,starttime,endtime)
``` Determine if start or end event ```
| eval event=if(event=1,1,-1)
``` Bucket into minutes ```
| bin _time span=1m
``` Move end time to next minute ```
| eval _time=if(event=-1,_time+60,_time)
``` Sort by _time ```
| sort 0 _time
``` Count events started in each minute minus those finished in the previous minute ```
| streamstats sum(event) as ongoing
``` Take maximum for each minute ```
| stats max(ongoing) as ongoing by _time
``` Fill in intervening minutes ```
| makecontinuous _time span=1m
``` Fill in ongoing values ```
| filldown ongoing&lt;/LI-CODE&gt;&lt;P&gt;You shouldn't need to take eventId into account so long as there is just one event per event Id&lt;/P&gt;</description>
    <pubDate>Mon, 07 Nov 2022 10:46:38 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2022-11-07T10:46:38Z</dc:date>
    <item>
      <title>How to visualize ongoing actions based on start/stop time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619807#M215405</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I have events which are received when action is finished on my system. Event contains start and stop time for action and unique action_id.&amp;nbsp; So my event data is something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;
&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="karjsim_0-1667807588157.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/22363i84A045A651AE26DD/image-size/medium?v=v2&amp;amp;px=400" role="button" title="karjsim_0-1667807588157.png" alt="karjsim_0-1667807588157.png" /&gt;&lt;/span&gt;&lt;/P&gt;
&lt;P&gt;&lt;BR /&gt;I would like to get count of ongoing actions e.g with one minute resolution over selected time frame.&lt;BR /&gt;&lt;BR /&gt;How to do that ?&lt;/P&gt;</description>
      <pubDate>Tue, 08 Nov 2022 15:43:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619807#M215405</guid>
      <dc:creator>karjsim</dc:creator>
      <dc:date>2022-11-08T15:43:26Z</dc:date>
    </item>
    <item>
      <title>Re: Visualize ongoing actions based on start/stop time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619809#M215407</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/251003"&gt;@karjsim&lt;/a&gt;,&lt;/P&gt;&lt;P&gt;you could try something like this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;your_search&amp;gt;
| eval diff=round((stoptime-starttime)/60,0))
| stats count BY diff&lt;/LI-CODE&gt;&lt;P&gt;Ciao.&lt;/P&gt;&lt;P&gt;Giuseppe&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 08:04:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619809#M215407</guid>
      <dc:creator>gcusello</dc:creator>
      <dc:date>2022-11-07T08:04:39Z</dc:date>
    </item>
    <item>
      <title>Re: Visualize ongoing actions based on start/stop time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619811#M215409</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;That does not show me how many actions are ongoing . What I want is to get count of ongoing actions e.g for every minute for last 24h. So basically like timechart of ongoing actions overtime but the problem is that since I have only one event which contains start/stop times of action I cannot use timechart.&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 08:14:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619811#M215409</guid>
      <dc:creator>karjsim</dc:creator>
      <dc:date>2022-11-07T08:14:38Z</dc:date>
    </item>
    <item>
      <title>Re: Visualize ongoing actions based on start/stop time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619814#M215410</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eval time=mvappend(starttime, endtime)
| mvexpand time
| eval _time=time
| eval event=if(_time=starttime,1,-1)
| sort 0 -time
| streamstats sum(event) as ongoing&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 07 Nov 2022 08:21:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619814#M215410</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-11-07T08:21:43Z</dc:date>
    </item>
    <item>
      <title>Re: Visualize ongoing actions based on start/stop time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619819#M215412</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;It does not provide the needed result either. What I need is count of ongoing actions for e.g every minute.&lt;BR /&gt;&lt;BR /&gt;Something like this:&lt;BR /&gt;&lt;BR /&gt;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="karjsim_0-1667809994866.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/22364iEBFFA29DB0952FC0/image-size/medium?v=v2&amp;amp;px=400" role="button" title="karjsim_0-1667809994866.png" alt="karjsim_0-1667809994866.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;Problem is that how to count ongoing actions on each time ? Somehow it should be searched if that time is between actions start - stop time and if it is action is ongoing on that time ?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 08:48:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619819#M215412</guid>
      <dc:creator>karjsim</dc:creator>
      <dc:date>2022-11-07T08:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Visualize ongoing actions based on start/stop time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619820#M215413</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;``` Duplicate events with start and end times ```
| eval time=mvappend(starttime, endtime)
| mvexpand time
``` Reset event time ```
| eval _time=time
``` Determine if start or end event ```
| eval event=if(_time=starttime,1,-1)
``` Bucket into minutes ```
| bin _time span=1m
``` Move end time to next minute ```
| eval _time=if(event=-1,_time+60,_time)
``` Sort by _time ```
| sort 0 -time
``` Count events started in each minute minus those finished in the previous minute ```
| timechart sum(event) as ongoing span=1m&lt;/LI-CODE&gt;</description>
      <pubDate>Mon, 07 Nov 2022 08:54:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619820#M215413</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-11-07T08:54:16Z</dc:date>
    </item>
    <item>
      <title>Re: Visualize ongoing actions based on start/stop time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619823#M215415</link>
      <description>&lt;P&gt;Hi,&lt;BR /&gt;&lt;BR /&gt;I don't think that you understand my problem.&lt;BR /&gt;&lt;BR /&gt;These actions on my system can be long lasting e.g hours or short e.g minutes from each action I have get one event after action is finished (which contains start/stop times and unique action_id).&lt;BR /&gt;&lt;BR /&gt;And I would like to know how many actions were ongoing in each minute e.g in past 24h. &amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 09:20:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619823#M215415</guid>
      <dc:creator>karjsim</dc:creator>
      <dc:date>2022-11-07T09:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: Visualize ongoing actions based on start/stop time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619827#M215416</link>
      <description>&lt;P&gt;Thank you for explaining your problem in more detail - try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;``` Duplicate events with start and end times ```
| eval time=mvappend(starttime, endtime)
| mvexpand time
``` Reset event time ```
| eval _time=time
``` Determine if start or end event ```
| eval event=if(_time=starttime,1,-1)
``` Bucket into minutes ```
| bin _time span=1m
``` Move end time to next minute ```
| eval _time=if(event=-1,_time+60,_time)
``` Sort by _time ```
| sort 0 _time
``` Count events started in each minute minus those finished in the previous minute ```
| streamstats sum(event) as ongoing
``` Take maximum for each minute ```
| stats max(ongoing) as ongoing by _time
``` Fill in intervening minutes ```
| makecontinuous _time span=1m
``` Fill in ongoing values ```
| filldown ongoing&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 09:47:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619827#M215416</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-11-07T09:47:51Z</dc:date>
    </item>
    <item>
      <title>Re: Visualize ongoing actions based on start/stop time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619835#M215423</link>
      <description>&lt;P&gt;This will give me negative decreasing ongoing value over time.&lt;BR /&gt;Also you are now just focusing to start/stop times but you also need to take account that different actions can start or stop at the same time. I think that also action_id should be taken into account in search ?&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 10:23:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619835#M215423</guid>
      <dc:creator>karjsim</dc:creator>
      <dc:date>2022-11-07T10:23:36Z</dc:date>
    </item>
    <item>
      <title>Re: Visualize ongoing actions based on start/stop time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619844#M215428</link>
      <description>&lt;P&gt;Please share your search - it sounds like you may have changed _time before determining the event type&lt;/P&gt;&lt;P&gt;Alternatively, you could do it this way&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;``` Duplicate events ```
| eval event=mvrange(1,3)
| mvexpand event
``` Reset event time ```
| eval _time=if(event=1,starttime,endtime)
``` Determine if start or end event ```
| eval event=if(event=1,1,-1)
``` Bucket into minutes ```
| bin _time span=1m
``` Move end time to next minute ```
| eval _time=if(event=-1,_time+60,_time)
``` Sort by _time ```
| sort 0 _time
``` Count events started in each minute minus those finished in the previous minute ```
| streamstats sum(event) as ongoing
``` Take maximum for each minute ```
| stats max(ongoing) as ongoing by _time
``` Fill in intervening minutes ```
| makecontinuous _time span=1m
``` Fill in ongoing values ```
| filldown ongoing&lt;/LI-CODE&gt;&lt;P&gt;You shouldn't need to take eventId into account so long as there is just one event per event Id&lt;/P&gt;</description>
      <pubDate>Mon, 07 Nov 2022 10:46:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-visualize-ongoing-actions-based-on-start-stop-time/m-p/619844#M215428</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2022-11-07T10:46:38Z</dc:date>
    </item>
  </channel>
</rss>

