<?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: Why use eventstats and stats together? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Why-use-eventstats-and-stats-together/m-p/546588#M154955</link>
    <description>&lt;P&gt;eventstats adds fields to the events and preserves the existing fields&lt;/P&gt;&lt;P&gt;stats replaces the events with calculated fields&lt;/P&gt;&lt;P&gt;For example, let's say you wanted to chart percentage of events from each host per day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; ... | bin span=1d _time
| stats count BY _time host
| eventstats sum(count) as total by _time
| eval percent = count / total
| chart values(percent) by _time host&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;stats does the counting by time and host&lt;/P&gt;&lt;P&gt;eventstats calculates the daily total&lt;/P&gt;&lt;P&gt;eval calculates the daily percentage for each host&lt;/P&gt;</description>
    <pubDate>Sat, 03 Apr 2021 08:00:11 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-04-03T08:00:11Z</dc:date>
    <item>
      <title>Why use eventstats and stats together?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-use-eventstats-and-stats-together/m-p/546587#M154954</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;&lt;P&gt;I have seen eventstats and stats used together, but I’m not clear on why and when the use of the mentioned would need to be used.&lt;/P&gt;&lt;P&gt;can you explain why use eventstats and stats together and provide an example?&lt;/P&gt;</description>
      <pubDate>Sat, 03 Apr 2021 06:31:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-use-eventstats-and-stats-together/m-p/546587#M154954</guid>
      <dc:creator>luna</dc:creator>
      <dc:date>2021-04-03T06:31:06Z</dc:date>
    </item>
    <item>
      <title>Re: Why use eventstats and stats together?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-use-eventstats-and-stats-together/m-p/546588#M154955</link>
      <description>&lt;P&gt;eventstats adds fields to the events and preserves the existing fields&lt;/P&gt;&lt;P&gt;stats replaces the events with calculated fields&lt;/P&gt;&lt;P&gt;For example, let's say you wanted to chart percentage of events from each host per day&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt; ... | bin span=1d _time
| stats count BY _time host
| eventstats sum(count) as total by _time
| eval percent = count / total
| chart values(percent) by _time host&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;stats does the counting by time and host&lt;/P&gt;&lt;P&gt;eventstats calculates the daily total&lt;/P&gt;&lt;P&gt;eval calculates the daily percentage for each host&lt;/P&gt;</description>
      <pubDate>Sat, 03 Apr 2021 08:00:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-use-eventstats-and-stats-together/m-p/546588#M154955</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-04-03T08:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: Why use eventstats and stats together?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Why-use-eventstats-and-stats-together/m-p/546625#M154960</link>
      <description>&lt;P&gt;In a similar vein to&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;'s answer, I sometimes combine them for filtering, although this example is contrived:&lt;/P&gt;&lt;P&gt;| stats count by foo&lt;BR /&gt;| eventstats max(count) as mode&lt;BR /&gt;| where count==mode&lt;/P&gt;</description>
      <pubDate>Sun, 04 Apr 2021 14:56:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Why-use-eventstats-and-stats-together/m-p/546625#M154960</guid>
      <dc:creator>tscroggins</dc:creator>
      <dc:date>2021-04-04T14:56:17Z</dc:date>
    </item>
  </channel>
</rss>

