<?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 How to count IDs that are in the range between current_time and end_time for each second? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-IDs-that-are-in-the-range-between-current-time-and/m-p/251175#M75034</link>
    <description>&lt;P&gt;I want to count up IDs which are in the range between current_time and end_time for each second.&lt;BR /&gt;
For example, as for the following data source table, count 1 during 13:17:44 - 13:18:17 only for id: 1cf789ef, then count 2 during 13:18:17 - 13:18:21 for id: 1cf789ef and 3c05282c. Then I want it to be line chart.&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/178177-screen-shot-2017-01-24-124159-pm.png" alt="Data Source" /&gt;&lt;/P&gt;

&lt;P&gt;Output should look like...&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/178178-screen-shot-2017-01-24-125912-pm.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;How do I achieve this?&lt;/P&gt;</description>
    <pubDate>Tue, 29 Sep 2020 12:31:49 GMT</pubDate>
    <dc:creator>diavolo</dc:creator>
    <dc:date>2020-09-29T12:31:49Z</dc:date>
    <item>
      <title>How to count IDs that are in the range between current_time and end_time for each second?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-IDs-that-are-in-the-range-between-current-time-and/m-p/251175#M75034</link>
      <description>&lt;P&gt;I want to count up IDs which are in the range between current_time and end_time for each second.&lt;BR /&gt;
For example, as for the following data source table, count 1 during 13:17:44 - 13:18:17 only for id: 1cf789ef, then count 2 during 13:18:17 - 13:18:21 for id: 1cf789ef and 3c05282c. Then I want it to be line chart.&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/178177-screen-shot-2017-01-24-124159-pm.png" alt="Data Source" /&gt;&lt;/P&gt;

&lt;P&gt;Output should look like...&lt;BR /&gt;
&lt;IMG src="https://community.splunk.com/storage/temp/178178-screen-shot-2017-01-24-125912-pm.png" alt="alt text" /&gt;&lt;/P&gt;

&lt;P&gt;How do I achieve this?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 12:31:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-IDs-that-are-in-the-range-between-current-time-and/m-p/251175#M75034</guid>
      <dc:creator>diavolo</dc:creator>
      <dc:date>2020-09-29T12:31:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to count IDs that are in the range between current_time and end_time for each second?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-IDs-that-are-in-the-range-between-current-time-and/m-p/251176#M75035</link>
      <description>&lt;P&gt;If a line chart is the end goal, you could use concurrency to find the number of overlapping events, along with gentimes to create an event for every second. You will need to adjust the parameters of gentimes depending on the time you want your graph to show. This will not however list each individual id, only a count of the number of id's. Try the following search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;&amp;lt;your_current_search&amp;gt; | table id, current_time, end_time | eval starttime=strptime(current_time,"%Y/%m/%d %H:%M:%S") | eval endtime=strptime(end_time,"%Y/%m/%d %H:%M:%S") | eval duration = endtime-starttime | append [|gentimes start=01/21/2017:13:00:00 end=01/21/2017:15:00:00 increment=1s | eval type="gentimes" | eval duration=1] | concurrency start=starttime duration=duration | where type="gentimes" | eval concurrency=concurrency-1 | rename starttime AS _time | timechart span=1s max(concurrency) AS "Number of Id's"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 24 Jan 2017 05:45:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-IDs-that-are-in-the-range-between-current-time-and/m-p/251176#M75035</guid>
      <dc:creator>lquinn</dc:creator>
      <dc:date>2017-01-24T05:45:15Z</dc:date>
    </item>
    <item>
      <title>Re: How to count IDs that are in the range between current_time and end_time for each second?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-IDs-that-are-in-the-range-between-current-time-and/m-p/251177#M75036</link>
      <description>&lt;P&gt;You need the &lt;CODE&gt;concurrency&lt;/CODE&gt; command:&lt;/P&gt;

&lt;P&gt;&lt;A href="https://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Concurrency"&gt;https://docs.splunk.com/Documentation/Splunk/6.5.1/SearchReference/Concurrency&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 05:47:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-IDs-that-are-in-the-range-between-current-time-and/m-p/251177#M75036</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-01-24T05:47:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to count IDs that are in the range between current_time and end_time for each second?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-IDs-that-are-in-the-range-between-current-time-and/m-p/251178#M75037</link>
      <description>&lt;P&gt;Great!!! This is exactly what I wanted.&lt;BR /&gt;
Thank you!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 07:18:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-IDs-that-are-in-the-range-between-current-time-and/m-p/251178#M75037</guid>
      <dc:creator>diavolo</dc:creator>
      <dc:date>2017-01-24T07:18:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to count IDs that are in the range between current_time and end_time for each second?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-IDs-that-are-in-the-range-between-current-time-and/m-p/251179#M75038</link>
      <description>&lt;P&gt;Thank you! I didn't know concurrency command. Very useful!!&lt;/P&gt;</description>
      <pubDate>Tue, 24 Jan 2017 07:18:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-IDs-that-are-in-the-range-between-current-time-and/m-p/251179#M75038</guid>
      <dc:creator>diavolo</dc:creator>
      <dc:date>2017-01-24T07:18:33Z</dc:date>
    </item>
  </channel>
</rss>

