<?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: How to count event between different time in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/524965#M148095</link>
    <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/80737"&gt;@inventsekar&lt;/a&gt;&amp;nbsp;, but it did not group date together by time range, instead, it counts Area separately. Can you give me other solution to count and group areas together by time range?&lt;/P&gt;</description>
    <pubDate>Thu, 15 Oct 2020 22:51:34 GMT</pubDate>
    <dc:creator>vgrand2</dc:creator>
    <dc:date>2020-10-15T22:51:34Z</dc:date>
    <item>
      <title>How to count event between different time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/524954#M148090</link>
      <description>&lt;P&gt;Hi Splunk community,&lt;/P&gt;&lt;P&gt;How to count number of "area" between time range to show results like these:&lt;/P&gt;&lt;P&gt;Between 1/1/19 to 6/30/19, there are 2 areas&lt;/P&gt;&lt;P&gt;Between 7/1/19 to 12/31/19, there are 2&lt;/P&gt;&lt;P&gt;Between 1/1/20 to 6/30/20, there are 0&lt;/P&gt;&lt;P&gt;Between 7/1/20 to 12/31/20, there is 1&lt;/P&gt;&lt;P&gt;Between 1/1/21 to 12/31/21, there is 1&lt;/P&gt;&lt;P&gt;After 1/1/22, there are 2&lt;/P&gt;&lt;P&gt;=&amp;gt; Raw data like this:&amp;nbsp;&lt;/P&gt;&lt;TABLE border="0" width="311" cellspacing="0" cellpadding="0"&gt;&lt;TBODY&gt;&lt;TR&gt;&lt;TD width="163" height="21"&gt;Area&lt;/TD&gt;&lt;TD width="148"&gt;forecast_date&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="21"&gt;area 1&lt;/TD&gt;&lt;TD&gt;6/17/19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="21"&gt;area 2&lt;/TD&gt;&lt;TD&gt;8/3/21&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="21"&gt;area 3&lt;/TD&gt;&lt;TD&gt;10/29/20&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="21"&gt;area 4&lt;/TD&gt;&lt;TD&gt;7/14/17&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="21"&gt;area 5&lt;/TD&gt;&lt;TD&gt;9/30/26&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="21"&gt;area 6&lt;/TD&gt;&lt;TD&gt;7/29/19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="21"&gt;area 7&lt;/TD&gt;&lt;TD&gt;9/16/19&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="21"&gt;area 8&lt;/TD&gt;&lt;TD&gt;3/4/24&lt;/TD&gt;&lt;/TR&gt;&lt;TR&gt;&lt;TD height="21"&gt;area 9&lt;/TD&gt;&lt;TD&gt;1/1/19&lt;/TD&gt;&lt;/TR&gt;&lt;/TBODY&gt;&lt;/TABLE&gt;</description>
      <pubDate>Thu, 15 Oct 2020 21:45:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/524954#M148090</guid>
      <dc:creator>vgrand2</dc:creator>
      <dc:date>2020-10-15T21:45:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to count event between different time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/524960#M148093</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/227678"&gt;@vgrand2&lt;/a&gt;&amp;nbsp; you have to convert the date to epoch and then easily count the areas between two epoch values.&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;base search | eval epochdates=strptime(forecast_date, "%m/%d/%y")
| chart count over Area BY epochdates &lt;/LI-CODE&gt;&lt;P&gt;there may be some modifications required, let us know how this above one goes, so that we can fine-tune the search query. thanks.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;~ Happy Splunking ~&amp;nbsp;Karma points are appreciated!&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 22:31:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/524960#M148093</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-10-15T22:31:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to count event between different time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/524965#M148095</link>
      <description>&lt;P&gt;Thanks&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/80737"&gt;@inventsekar&lt;/a&gt;&amp;nbsp;, but it did not group date together by time range, instead, it counts Area separately. Can you give me other solution to count and group areas together by time range?&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 22:51:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/524965#M148095</guid>
      <dc:creator>vgrand2</dc:creator>
      <dc:date>2020-10-15T22:51:34Z</dc:date>
    </item>
    <item>
      <title>Re: How to count event between different time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/524969#M148096</link>
      <description>&lt;P&gt;Please try this:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;base search | eval epochdates=strptime(forecast_date, "%m/%d/%y")
| chart count(Area) BY epochdates &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 23:08:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/524969#M148096</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-10-15T23:08:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to count event between different time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/524973#M148097</link>
      <description>&lt;P&gt;That one did not work.&lt;/P&gt;&lt;P&gt;The previous one worked but it gave the result separately area by area, not group some areas together.&lt;/P&gt;&lt;PRE&gt;| chart count over Area BY epochdates &lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I tried to use between time but it did not show anything at all.&lt;/P&gt;&lt;P&gt;earliest=10/1/2020:00:00:00 latest=01/1/2021:23:59:59&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 23:18:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/524973#M148097</guid>
      <dc:creator>vgrand2</dc:creator>
      <dc:date>2020-10-15T23:18:11Z</dc:date>
    </item>
    <item>
      <title>Re: How to count event between different time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/524976#M148099</link>
      <description>&lt;P&gt;please try streamstats:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;base search | eval epochdates=strptime(forecast_date, "%m/%d/%y")
| streamstats count(Area) by epochdates
| delta count as diff_count&lt;/LI-CODE&gt;&lt;P&gt;&lt;SPAN&gt;&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 15 Oct 2020 23:32:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/524976#M148099</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-10-15T23:32:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to count event between different time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/525014#M148113</link>
      <description>&lt;P&gt;It did not work since it didnt group different areas from date range.&lt;/P&gt;&lt;P&gt;I am thinking about using Dropdown menu, but I don't know how to connect the token into the search query&lt;/P&gt;&lt;P&gt;&amp;lt;input type="dropdown" token="time_token" searchWhenChanged="true"&amp;gt;&lt;BR /&gt;&amp;lt;label&amp;gt;Select any Time Period&amp;lt;/label&amp;gt;&lt;BR /&gt;&amp;lt;choice value="earliest=-720d@d latest=now"&amp;gt;Today&amp;lt;/choice&amp;gt;&lt;BR /&gt;&amp;lt;choice value="earliest=now latest=+@90d@d"&amp;gt;Next 3 months&amp;lt;/choice&amp;gt;&lt;BR /&gt;&amp;lt;choice value="earliest=now latest=+@180d@d"&amp;gt;Next 6 months&amp;lt;/choice&amp;gt;&lt;BR /&gt;&amp;lt;choice value="earliest=now latest=+@270d@d"&amp;gt;Next 9 months&amp;lt;/choice&amp;gt;&lt;BR /&gt;&amp;lt;choice value="earliest=now latest=+@360d@d"&amp;gt;Next 12 months&amp;lt;/choice&amp;gt;&lt;BR /&gt;&amp;lt;choice value="earliest=now latest=+540d@d"&amp;gt;Next 18 months&amp;lt;/choice&amp;gt;&lt;BR /&gt;&amp;lt;choice value="earliest=now latest=+730d@d"&amp;gt;Next 24 months&amp;lt;/choice&amp;gt;&lt;BR /&gt;&amp;lt;default&amp;gt;earliest=-720d@d latest=now&amp;lt;/default&amp;gt;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 07:38:50 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/525014#M148113</guid>
      <dc:creator>vgrand2</dc:creator>
      <dc:date>2020-10-16T07:38:50Z</dc:date>
    </item>
    <item>
      <title>Re: How to count event between different time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/525017#M148114</link>
      <description>&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;gt;&amp;gt;&amp;gt; I am thinking about using Dropdown menu, but I don't know how to connect the token into the search query&amp;lt;&amp;lt;&amp;lt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;BR /&gt;on the search query, you need to specify: base search earliest="$earliestToken" latest="$latestToken$"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;&amp;lt;form&amp;gt;
  &amp;lt;label&amp;gt;test-token&amp;lt;/label&amp;gt;
  &amp;lt;fieldset submitButton="false"&amp;gt;
    &amp;lt;input type="dropdown" token="earliestToken" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;earliestToken&amp;lt;/label&amp;gt;
      &amp;lt;choice value="-30m"&amp;gt;30m ago&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="-60m"&amp;gt;60m ago&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
    &amp;lt;input type="dropdown" token="latestToken" searchWhenChanged="true"&amp;gt;
      &amp;lt;label&amp;gt;latestToken&amp;lt;/label&amp;gt;
      &amp;lt;choice value="now"&amp;gt;now&amp;lt;/choice&amp;gt;
      &amp;lt;choice value="-15m"&amp;gt;15m ago&amp;lt;/choice&amp;gt;
    &amp;lt;/input&amp;gt;
  &amp;lt;/fieldset&amp;gt;
  &amp;lt;row&amp;gt;
    &amp;lt;panel&amp;gt;
      &amp;lt;title&amp;gt;token&amp;lt;/title&amp;gt;
      &amp;lt;event&amp;gt;
        &amp;lt;search&amp;gt;
          &amp;lt;query&amp;gt;index="_internal" earliest="$earliestToken$" latest="$latestToken$"&amp;lt;/query&amp;gt;
          &amp;lt;earliest&amp;gt;-15m&amp;lt;/earliest&amp;gt;
          &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
          &amp;lt;sampleRatio&amp;gt;1&amp;lt;/sampleRatio&amp;gt;
        &amp;lt;/search&amp;gt;&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>Fri, 16 Oct 2020 08:38:42 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/525017#M148114</guid>
      <dc:creator>inventsekar</dc:creator>
      <dc:date>2020-10-16T08:38:42Z</dc:date>
    </item>
    <item>
      <title>Re: How to count event between different time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/525136#M148152</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/80737"&gt;@inventsekar&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;why don't we have both token with time rage not related to each other? I really don't get it.&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 20:14:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/525136#M148152</guid>
      <dc:creator>vgrand2</dc:creator>
      <dc:date>2020-10-16T20:14:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to count event between different time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/525137#M148153</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/80737"&gt;@inventsekar&lt;/a&gt;&amp;nbsp;did you mean easiest and latest are not the Splunk value?&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 16 Oct 2020 20:20:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/525137#M148153</guid>
      <dc:creator>vgrand2</dc:creator>
      <dc:date>2020-10-16T20:20:08Z</dc:date>
    </item>
    <item>
      <title>Re: How to count event between different time</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/525138#M148154</link>
      <description>&lt;P&gt;Try something like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;base search | eval _time=strptime(forecast_date, "%m/%d/%y")
| timechart span=6mon count as areas
| eval period="Between "+ strftime(_time,"%m/%d/%y")+ " and " + strftime(relative_time(_time,"+6mon-1d"),"%m/%d/%y")
| table period areas&lt;/LI-CODE&gt;</description>
      <pubDate>Fri, 16 Oct 2020 20:22:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-count-event-between-different-time/m-p/525138#M148154</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2020-10-16T20:22:53Z</dc:date>
    </item>
  </channel>
</rss>

