<?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: Using summary index data to compare event count between different days in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Using-summary-index-data-to-compare-event-count-between/m-p/284167#M85908</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary source="Summary - DC Daily Event Count" orig_host=DOMAINCONTROLLER earliest=-8d@d latest=@d | eval WhichDay = case(_time&amp;gt;=relative_time(now(),"-1d@d"),"Yesterday", _time&amp;lt;=relative_time(now(),"-7d@d"),"LastWeek",1==1,null()) | where isnotnull(WhichDay) | chart count over index by WhichDay  | eval ChangePercent = (((Yesterday/LastWeek)-1)*100) |table ChangePercent
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Wed, 14 Sep 2016 16:01:41 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2016-09-14T16:01:41Z</dc:date>
    <item>
      <title>Using summary index data to compare event count between different days</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-summary-index-data-to-compare-event-count-between/m-p/284166#M85907</link>
      <description>&lt;P&gt;I'm using a cool search I found on Answers to compare the event count from yesterday to the same day last week for our DC's&lt;BR /&gt;
This search works really well and I have created a dashboard showing which servers are generating the most events, and more importantly, any which show a reduction in their activity.&lt;BR /&gt;
The problem is the search is really big!! 25 - 30 million events and takes an age to run. I scheduled it to run overnight, but still takes a while per server to complete. Running it during the day takes forever....&lt;/P&gt;

&lt;P&gt;So I have tried Summary indexing, I have it running well, and can get all the data in fraction of the time for adhoc serches, but I can't get it to run the same comparison search. Problem is, the summary index has an event count field (psrsvd_gc) and I can get an event count using the orig_host field, but I can't work out how to plug them into this search to compare yesterday with last week:&lt;/P&gt;

&lt;P&gt;index=wineventlog  sourcetype="XmlWinEventLog:Security" host=DOMAINCONTROLLER earliest=-8d@d latest=@d | eval WhichDay = case(_time&amp;gt;=relative_time(now(),"-1d@d"),"Yesterday", _time&amp;lt;=relative_time(now(),"-7d@d"),"LastWeek",1==1,null())  | stats count(eval(WhichDay=="Yesterday")) as Yesterday count(eval(WhichDay=="LastWeek")) as LastWeek   | eval ChangePercent = (((Yesterday/LastWeek)-1)*100)  |table ChangePercent&lt;/P&gt;

&lt;P&gt;The summary index search:&lt;/P&gt;

&lt;P&gt;index=wineventlog source="WinEventLog:Security" host="&lt;EM&gt;DC&lt;/EM&gt;"| sistats count by host&lt;/P&gt;

&lt;P&gt;and this is the comparison search using the summary index:&lt;/P&gt;

&lt;P&gt;index=summary source="Summary - DC Daily Event Count" orig_host=DOMAINCONTROLLER earliest=-8d@d latest=@d | eval WhichDay = case(_time&amp;gt;=relative_time(now(),"-1d@d"),"Yesterday", _time&amp;lt;=relative_time(now(),"-7d@d"),"LastWeek",1==1,null())  | stats count(eval(WhichDay=="Yesterday")) as Yesterday count(eval(WhichDay=="LastWeek")) as LastWeek   | eval ChangePercent = (((Yesterday/LastWeek)-1)*100)  |table ChangePercent&lt;/P&gt;

&lt;P&gt;Any help gratefully received!!&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:00:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-summary-index-data-to-compare-event-count-between/m-p/284166#M85907</guid>
      <dc:creator>capilarity</dc:creator>
      <dc:date>2020-09-29T11:00:57Z</dc:date>
    </item>
    <item>
      <title>Re: Using summary index data to compare event count between different days</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-summary-index-data-to-compare-event-count-between/m-p/284167#M85908</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary source="Summary - DC Daily Event Count" orig_host=DOMAINCONTROLLER earliest=-8d@d latest=@d | eval WhichDay = case(_time&amp;gt;=relative_time(now(),"-1d@d"),"Yesterday", _time&amp;lt;=relative_time(now(),"-7d@d"),"LastWeek",1==1,null()) | where isnotnull(WhichDay) | chart count over index by WhichDay  | eval ChangePercent = (((Yesterday/LastWeek)-1)*100) |table ChangePercent
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 14 Sep 2016 16:01:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-summary-index-data-to-compare-event-count-between/m-p/284167#M85908</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2016-09-14T16:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: Using summary index data to compare event count between different days</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Using-summary-index-data-to-compare-event-count-between/m-p/284168#M85909</link>
      <description>&lt;P&gt;Thanks, works like a dream!! &lt;/P&gt;

&lt;P&gt;There was a typo in the my original search, so for the benefit of anyone else using this, if you want to compare yesterday with the same day a week ago, the "WhichDay" eval statement should use -1d@d for "Yesterday" and -&lt;STRONG&gt;8&lt;/STRONG&gt;d@d for "LastWeek" or you're comparing the wrong days&lt;/P&gt;

&lt;P&gt;eval WhichDay = case(_time&amp;gt;=relative_time(now(),"-1d@d"),"Yesterday", _time&amp;lt;=relative_time(now(),"-8d@d"),"LastWeek",1==1,null())&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 11:01:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Using-summary-index-data-to-compare-event-count-between/m-p/284168#M85909</guid>
      <dc:creator>capilarity</dc:creator>
      <dc:date>2020-09-29T11:01:21Z</dc:date>
    </item>
  </channel>
</rss>

