<?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 active connections between start end end times in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617561#M214614</link>
    <description>&lt;P&gt;How do you distinguished the different connections? e.g. by source ip, session id, or user?&lt;/P&gt;&lt;P&gt;For active connections, do you need to account for CONSTA that began at an earlier interval? For example, if CONSTA at 3:30PM and CONEND at 5:30PM, the connection will need to be accounted for in each interval between 3:30 and 5:30pm.&lt;/P&gt;&lt;P&gt;Some sample data could help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 18 Oct 2022 16:36:21 GMT</pubDate>
    <dc:creator>johnhuang</dc:creator>
    <dc:date>2022-10-18T16:36:21Z</dc:date>
    <item>
      <title>How to make timechart active connections between start end end times?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617547#M214611</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;
&lt;P&gt;Any thoughts appreciated.&lt;/P&gt;
&lt;P&gt;I have some connection data captured at connection termination, it has connection start and end times. CONSTA and CONEND in the format&amp;nbsp;"2022-10-18 15:40:00.000000".&lt;BR /&gt;What I'd like to do is timechart in say 5 minute intervals the number of connections that were active in those intervals. So all connections in an interval 15:40 - 15:45 that had started but not terminated and repeat that across the timechart so 15:45 - 15:50 etc.&lt;BR /&gt;Hopefully that make sense.&lt;/P&gt;
&lt;P&gt;Thanks in advance&lt;BR /&gt;Steve&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 17:52:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617547#M214611</guid>
      <dc:creator>mcaulsc</dc:creator>
      <dc:date>2022-10-18T17:52:21Z</dc:date>
    </item>
    <item>
      <title>Re: timechart active connections between start end end times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617561#M214614</link>
      <description>&lt;P&gt;How do you distinguished the different connections? e.g. by source ip, session id, or user?&lt;/P&gt;&lt;P&gt;For active connections, do you need to account for CONSTA that began at an earlier interval? For example, if CONSTA at 3:30PM and CONEND at 5:30PM, the connection will need to be accounted for in each interval between 3:30 and 5:30pm.&lt;/P&gt;&lt;P&gt;Some sample data could help.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 18 Oct 2022 16:36:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617561#M214614</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-10-18T16:36:21Z</dc:date>
    </item>
    <item>
      <title>Re: timechart active connections between start end end times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617662#M214657</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;Connections can be distinguished by PORT in this example. So the count would be any records that have started before or during the interval but not terminated.&lt;/P&gt;&lt;P&gt;Sample data:&lt;/P&gt;&lt;P&gt;PORT&amp;nbsp; &amp;nbsp;CONSTA&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;CONEND&lt;BR /&gt;55300 2022-10-15 07:33:40.919446 2022-10-19 07:25:46.440451&lt;BR /&gt;55300 2022-10-15 07:33:57.704310 2022-10-19 07:17:45.082410&lt;BR /&gt;55300 2022-10-15 07:34:39.447813 2022-10-19 07:25:42.237149&lt;BR /&gt;55300 2022-10-15 07:34:48.125852 2022-10-19 07:38:46.745400&lt;BR /&gt;55300 2022-10-15 07:34:55.561466 2022-10-19 07:33:44.027628&lt;BR /&gt;55300 2022-10-15 07:48:57.706834 2022-10-19 07:17:45.086782&lt;BR /&gt;55300 2022-10-15 07:57:37.375340 2022-10-19 07:24:24.382886&lt;BR /&gt;55300 2022-10-15 08:01:05.756897 2022-10-19 06:50:45.339550&lt;BR /&gt;55300 2022-10-15 08:02:24.329066 2022-10-19 07:22:37.247145&lt;BR /&gt;55300 2022-10-15 08:21:32.202534 2022-10-19 06:46:35.348080&lt;BR /&gt;55300 2022-10-15 08:44:39.721370 2022-10-19 07:38:46.746090&lt;BR /&gt;55300 2022-10-15 08:59:03.215559 2022-10-19 07:39:39.372292&lt;BR /&gt;55300 2022-10-16 15:08:47.255462 2022-10-19 07:24:24.353308&lt;BR /&gt;55300 2022-10-16 17:37:33.308594 2022-10-19 06:50:45.328513&lt;BR /&gt;55300 2022-10-17 10:00:11.261248 2022-10-18 10:00:12.426608&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 08:42:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617662#M214657</guid>
      <dc:creator>mcaulsc</dc:creator>
      <dc:date>2022-10-19T08:42:29Z</dc:date>
    </item>
    <item>
      <title>Re: timechart active connections between start end end times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617704#M214669</link>
      <description>&lt;P&gt;I have a few ideas but I like to have a better understanding --&lt;/P&gt;&lt;P&gt;Are there any other events, e.g. polling, heartbeat, keep alive, etc, available that could leveraged to determine what ports are active for each time interval?&lt;/P&gt;&lt;P&gt;How big is the dataset? Roughly how many hosts and ports are in scope for this report?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 13:57:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617704#M214669</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-10-19T13:57:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to make timechart active connections between start end end times?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617708#M214672</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;In the data there is nothing else, of that type, lots of other connection data but not that would help us, it is essentially a dataset of records cut at socket termination. Each report would be for limited ports, 1 normally maybe 3 in unusual circumstances, but code for 1 would work. Dataset size to be honest no idea, I don't manage that, but I'd guess up to 1GB.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 14:04:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617708#M214672</guid>
      <dc:creator>mcaulsc</dc:creator>
      <dc:date>2022-10-19T14:04:50Z</dc:date>
    </item>
    <item>
      <title>Re: timechart active connections between start end end times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617758#M214688</link>
      <description>&lt;P&gt;Since you're looking for a running total of active connection, we're going to ignore the port. Basically the approach is:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;UL&gt;&lt;LI&gt;Extract all&amp;nbsp;start and end connection timestamps and convert it into epoch time.&lt;UL&gt;&lt;LI&gt;Note, if your splunk timezone doesn't match the event's timezone, you need to offset it.&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Expand the start and end time into its own event and sort by oldest to newest.&lt;/LI&gt;&lt;LI&gt;Calculate the running total with accum&lt;UL&gt;&lt;LI&gt;Each start event +1 to total&lt;/LI&gt;&lt;LI&gt;Each end event -1 to total&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;LI&gt;Run timechart&lt;UL&gt;&lt;LI&gt;If you want to show the max active connections per interval, use max(active_connections)&lt;/LI&gt;&lt;LI&gt;If you want to show the number of active connections at the end of the interval, use last(active_connections)&amp;nbsp;&lt;/LI&gt;&lt;/UL&gt;&lt;/LI&gt;&lt;/UL&gt;&lt;P&gt;&lt;BR /&gt;Using your sample data (not the best use case):&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| makeresults
| eval events="55300,2022-10-15 07:33:40.919446,2022-10-19 07:25:46.440451|55300,2022-10-15 07:33:57.704310,2022-10-19 07:17:45.082410|55300,2022-10-15 07:34:39.447813,2022-10-19 07:25:42.237149|55300,2022-10-15 07:34:48.125852,2022-10-19 07:38:46.745400|55300,2022-10-15 07:34:55.561466,2022-10-19 07:33:44.027628|55300,2022-10-15 07:48:57.706834,2022-10-19 07:17:45.086782|55300,2022-10-15 07:57:37.375340,2022-10-19 07:24:24.382886|55300,2022-10-15 08:01:05.756897,2022-10-19 06:50:45.339550|55300,2022-10-15 08:02:24.329066,2022-10-19 07:22:37.247145|55300,2022-10-15 08:21:32.202534,2022-10-19 06:46:35.348080|55300,2022-10-15 08:44:39.721370,2022-10-19 07:38:46.746090|55300,2022-10-15 08:59:03.215559,2022-10-19 07:39:39.372292|55300,2022-10-16 15:08:47.255462,2022-10-19 07:24:24.353308|55300,2022-10-16 17:37:33.308594,2022-10-19 06:50:45.328513|55300,2022-10-17 10:00:11.261248,2022-10-18 10:00:12.426608"
| eval events=split(events, "|")
| mvexpand events
| rex field=events "^(?&amp;lt;PORT&amp;gt;\d+)\,(?&amp;lt;CONNSTA&amp;gt;[^\,]*)\,(?&amp;lt;CONNEND&amp;gt;[^\,]*)"

| eval start_time=strptime(CONNSTA, "%Y-%m-%d %H:%M:%S.%N")."|start"
| eval end_time=strptime(CONNEND, "%Y-%m-%d %H:%M:%S.%N")."|end"
| eval event_list=MVAPPEND(start_time, end_time)
| rex field=event_list "^(?&amp;lt;_time&amp;gt;\d+\.\d+)\|(?&amp;lt;event_type&amp;gt;.*)"
| eval event_count=CASE(event_type="start", 1, event_type="end", -1)
| sort 0 _time
| accum event_count AS active_connection
| timechart span=5m max(active_connection) AS active_connection
| fillnull value=0&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 19 Oct 2022 21:41:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617758#M214688</guid>
      <dc:creator>johnhuang</dc:creator>
      <dc:date>2022-10-19T21:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: timechart active connections between start end end times</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617863#M214730</link>
      <description>&lt;P&gt;Thanks,&lt;/P&gt;&lt;P&gt;Couple of new functions I not used yet in there, it certainly produces a timechart. I just need to reduce the data and try and validate what I see with the data.&lt;/P&gt;&lt;P&gt;Thanks for your time and the solution.&lt;/P&gt;</description>
      <pubDate>Thu, 20 Oct 2022 14:44:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-make-timechart-active-connections-between-start-end-end/m-p/617863#M214730</guid>
      <dc:creator>mcaulsc</dc:creator>
      <dc:date>2022-10-20T14:44:01Z</dc:date>
    </item>
  </channel>
</rss>

