<?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 Timechart and auto bin sizing in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-and-auto-bin-sizing/m-p/666263#M228562</link>
    <description>&lt;P&gt;What I am trying to do is graph / timechart active users.&amp;nbsp; &amp;nbsp;I am starting with this query:&lt;/P&gt;&lt;P&gt;index=anIndex sourcetype=perflogs&amp;nbsp;&lt;BR /&gt;| rex field=_raw "^(?:[^,\n]*,){2}(?P&amp;lt;LoginUserID&amp;gt;\w+\.\w+)"&lt;BR /&gt;| timechart distinct_count(LoginUserID) partial=false&lt;/P&gt;&lt;P&gt;This works and the resulting graph appears to be correct for 120 mins resulting in 5min time buckets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then if I shorten the time period down to 60 mins resulting in 1 min buckets then I have a question.&lt;/P&gt;&lt;P&gt;In the 120 min graph with 5 min buckets&amp;nbsp;@ 6:40-6:45 I have 318 Distinct Users but in the 90 min graph with 1 min buckets each 1 min bucket has 136, 144, 142, 131, 117 Distinct Users.&lt;/P&gt;&lt;P&gt;I understand that a user can be active one minute and inactive the next min or two and then active again on the 4th/5th min which is what is happening?&lt;/P&gt;&lt;P&gt;My question is how to get this to show across the one minute bin's users that were active in the previous 5, 1 min buckets resulting in a # that represents users that are logged in and not just active ?&lt;/P&gt;&lt;P&gt;I believe I can add minspan=5min as a kludge but am wondering if there is a way to get this do what im trying to show at the 1min span ?&lt;/P&gt;&lt;P&gt;I believe what I need to do is run two queries the first one as is above, then use an append that will query for&amp;nbsp; events from -5min to -10min.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, from what I have been trying it either is not working or not doing it correctly.&lt;/P&gt;&lt;P&gt;Basically im trying to find those userID's that are active in the first time bucket (1 min) that were also active in the previous time bucket(s) then do a distinct_count(..) on the usersID's collected from both queries ?&lt;/P&gt;</description>
    <pubDate>Thu, 26 Oct 2023 02:17:35 GMT</pubDate>
    <dc:creator>sjringo</dc:creator>
    <dc:date>2023-10-26T02:17:35Z</dc:date>
    <item>
      <title>Timechart and auto bin sizing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-and-auto-bin-sizing/m-p/666263#M228562</link>
      <description>&lt;P&gt;What I am trying to do is graph / timechart active users.&amp;nbsp; &amp;nbsp;I am starting with this query:&lt;/P&gt;&lt;P&gt;index=anIndex sourcetype=perflogs&amp;nbsp;&lt;BR /&gt;| rex field=_raw "^(?:[^,\n]*,){2}(?P&amp;lt;LoginUserID&amp;gt;\w+\.\w+)"&lt;BR /&gt;| timechart distinct_count(LoginUserID) partial=false&lt;/P&gt;&lt;P&gt;This works and the resulting graph appears to be correct for 120 mins resulting in 5min time buckets.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Then if I shorten the time period down to 60 mins resulting in 1 min buckets then I have a question.&lt;/P&gt;&lt;P&gt;In the 120 min graph with 5 min buckets&amp;nbsp;@ 6:40-6:45 I have 318 Distinct Users but in the 90 min graph with 1 min buckets each 1 min bucket has 136, 144, 142, 131, 117 Distinct Users.&lt;/P&gt;&lt;P&gt;I understand that a user can be active one minute and inactive the next min or two and then active again on the 4th/5th min which is what is happening?&lt;/P&gt;&lt;P&gt;My question is how to get this to show across the one minute bin's users that were active in the previous 5, 1 min buckets resulting in a # that represents users that are logged in and not just active ?&lt;/P&gt;&lt;P&gt;I believe I can add minspan=5min as a kludge but am wondering if there is a way to get this do what im trying to show at the 1min span ?&lt;/P&gt;&lt;P&gt;I believe what I need to do is run two queries the first one as is above, then use an append that will query for&amp;nbsp; events from -5min to -10min.&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;But, from what I have been trying it either is not working or not doing it correctly.&lt;/P&gt;&lt;P&gt;Basically im trying to find those userID's that are active in the first time bucket (1 min) that were also active in the previous time bucket(s) then do a distinct_count(..) on the usersID's collected from both queries ?&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 02:17:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-and-auto-bin-sizing/m-p/666263#M228562</guid>
      <dc:creator>sjringo</dc:creator>
      <dc:date>2023-10-26T02:17:35Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart and auto bin sizing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-and-auto-bin-sizing/m-p/666328#M228591</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| sort 0 _time
| streamstats time_window=5m dc(user) as unique_users
| timechart max(unique_users) as users span=1m&lt;/LI-CODE&gt;</description>
      <pubDate>Thu, 26 Oct 2023 10:57:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-and-auto-bin-sizing/m-p/666328#M228591</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2023-10-26T10:57:28Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart and auto bin sizing</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-and-auto-bin-sizing/m-p/666393#M228613</link>
      <description>&lt;P&gt;Im really not sure what this is doing. I incorporated it into my code and was not what I was expecting.&lt;/P&gt;&lt;P&gt;I have also shifted my efforts to using a span=15m for my timechart command due to some other calculations that are on the dashboard I am working on that using a span/bucket smaller than 15 minutes does not represent the data in the way the user(s) are expecting.&lt;/P&gt;&lt;P&gt;So, my next question (I can start a new thread if needed) is that using a span=15m for an hour sample of four 15 min buckets.&lt;/P&gt;&lt;P&gt;But, the buckets are at the 15 min mark of each hour and do not start from when the query is run.&lt;/P&gt;&lt;P&gt;i.e. Buckets = 0-15, 15-30, 30-45, 45-00.&amp;nbsp; Is there an option on timechart to force it to start at the current minute ?&lt;/P&gt;&lt;P&gt;I found in the documentation a reference to &amp;lt;snap-to-time&amp;gt; but dont understand how to use it.&lt;/P&gt;</description>
      <pubDate>Thu, 26 Oct 2023 14:59:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-and-auto-bin-sizing/m-p/666393#M228613</guid>
      <dc:creator>sjringo</dc:creator>
      <dc:date>2023-10-26T14:59:32Z</dc:date>
    </item>
  </channel>
</rss>

