<?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 a total count in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-a-total-count/m-p/475488#M133637</link>
    <description>&lt;PRE&gt;&lt;CODE&gt;index=cisco_asa Cisco_ASA_user=*
| reverse
| streamstats count(eval(searchmatch("connection established"))) as session by Cisco_ASA_user
| stats min(_time) as start max(_time) as end by session Cisco_ASA_user
| eval tmp=mvrange(start,end,3600)
| mvexpand tmp
| rename tmp as _time
| bin span=1h _time
| stats count as "Total Count" by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;VPN log has only  &lt;EM&gt;start&lt;/EM&gt; and &lt;EM&gt;end&lt;/EM&gt; of connection.&lt;BR /&gt;
It is necessary to make a log for the period in the middle.&lt;/P&gt;</description>
    <pubDate>Mon, 13 Apr 2020 22:28:54 GMT</pubDate>
    <dc:creator>to4kawa</dc:creator>
    <dc:date>2020-04-13T22:28:54Z</dc:date>
    <item>
      <title>Timechart a total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-a-total-count/m-p/475485#M133634</link>
      <description>&lt;P&gt;Hello, I am currently tracking a total count of VPN Users. I want to track the total over a timechart to see when the high and low parts are through out the day. Below I have provided the search I am using to get the total VPN Count. Could you please assist on editing the search to show it in timechart and the total count by each hour. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cisco_asa Cisco_ASA_user=*
| transaction fields=Cisco_ASA_user maxspan=12h30m connected=f startswith="*connection established*" 
| search eventtype!=cisco_vpn_end
| dedup user
| stats count by Cisco_ASA_user | eventstats sum(count) as totalCount 
| rename totalCount as "Total Count"
| table "Total Count"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Thanks, &lt;/P&gt;

&lt;P&gt;Cooper J&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 18:22:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-a-total-count/m-p/475485#M133634</guid>
      <dc:creator>cooperjaram</dc:creator>
      <dc:date>2020-04-13T18:22:01Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart a total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-a-total-count/m-p/475486#M133635</link>
      <description>&lt;P&gt;Will this get you close?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cisco_asa Cisco_ASA_user=*
| transaction fields=Cisco_ASA_user maxspan=12h30m connected=f startswith="*connection established*" 
| search eventtype!=cisco_vpn_end
| dedup user
| timechart span=1h count(user) AS UserCount
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;FYI, it is generally preferred to use &lt;CODE&gt;stats&lt;/CODE&gt; instead of &lt;CODE&gt;transaction&lt;/CODE&gt; like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| (your search)
| eval StartTime=if(match(_raw, "cisco_vpn_start"), _time, null())
| eval EndTime=if(match(_raw, "cisco_vpn_end"), _time, null())
| stats earliest(StartTime) as StartTime latest(EndTime) as EndTime by Cisco_ASA_user
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then you can search for full sessions (have both StartTime and EndTime) or abandoned (StartTime but missing and well overdue end times) or in progress (StartTime, no EndTime, but not long enough for timeout). You can do a lot with this info.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 19:29:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-a-total-count/m-p/475486#M133635</guid>
      <dc:creator>jpolvino</dc:creator>
      <dc:date>2020-04-13T19:29:39Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart a total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-a-total-count/m-p/475487#M133636</link>
      <description>&lt;P&gt;See if this gets you the desired results.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=cisco_asa Cisco_ASA_user=*
| transaction fields=Cisco_ASA_user maxspan=12h30m connected=f startswith="*connection established*" 
| search eventtype!=cisco_vpn_end
| dedup user
| stats count by _time
| timechart span=1h sum(count) as totalCount
| rename totalCount as "Total Count"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Apr 2020 19:34:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-a-total-count/m-p/475487#M133636</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2020-04-13T19:34:55Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart a total count</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-a-total-count/m-p/475488#M133637</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;index=cisco_asa Cisco_ASA_user=*
| reverse
| streamstats count(eval(searchmatch("connection established"))) as session by Cisco_ASA_user
| stats min(_time) as start max(_time) as end by session Cisco_ASA_user
| eval tmp=mvrange(start,end,3600)
| mvexpand tmp
| rename tmp as _time
| bin span=1h _time
| stats count as "Total Count" by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;VPN log has only  &lt;EM&gt;start&lt;/EM&gt; and &lt;EM&gt;end&lt;/EM&gt; of connection.&lt;BR /&gt;
It is necessary to make a log for the period in the middle.&lt;/P&gt;</description>
      <pubDate>Mon, 13 Apr 2020 22:28:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-a-total-count/m-p/475488#M133637</guid>
      <dc:creator>to4kawa</dc:creator>
      <dc:date>2020-04-13T22:28:54Z</dc:date>
    </item>
  </channel>
</rss>

