<?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 customize stats using simple math? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342793#M101540</link>
    <description>&lt;P&gt;This answer is very helpful and I've upvoted the answer - thank you! However, as it stands, both answers are equally valid, so I'm leaving it to the community to vote on them. &lt;/P&gt;</description>
    <pubDate>Fri, 09 Mar 2018 18:38:20 GMT</pubDate>
    <dc:creator>flow2k</dc:creator>
    <dc:date>2018-03-09T18:38:20Z</dc:date>
    <item>
      <title>How to customize stats using simple math?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342789#M101536</link>
      <description>&lt;P&gt;If I wanted a count of all the events in all my indices, I can just do:&lt;BR /&gt;
&lt;CODE&gt;index=* | stats count&lt;/CODE&gt;, which just returns a single number in a single row with this value.&lt;/P&gt;

&lt;P&gt;But say I wanted to customize the stats function - say I want to add 2 to the count returned:&lt;BR /&gt;
&lt;CODE&gt;index=* | stats count+2&lt;/CODE&gt; is invalid.&lt;/P&gt;

&lt;P&gt;How can I customize an aggregate statistics function with simple math operations?&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 21:14:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342789#M101536</guid>
      <dc:creator>flow2k</dc:creator>
      <dc:date>2018-03-08T21:14:43Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize stats using simple math?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342790#M101537</link>
      <description>&lt;P&gt;Try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| metasearch index=*
| stats count 
| eval count='count'+2
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You need to use an &lt;CODE&gt;eval&lt;/CODE&gt; to do basic mathematical calculations &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Metasearch&lt;/CODE&gt; will look at your index time fields and search 10x faster than doing &lt;CODE&gt;index=*&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 21:42:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342790#M101537</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-03-08T21:42:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize stats using simple math?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342791#M101538</link>
      <description>&lt;P&gt;index=* | stats count AS count| eval count = count + 2&lt;/P&gt;</description>
      <pubDate>Thu, 08 Mar 2018 21:44:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342791#M101538</guid>
      <dc:creator>damiensurat</dc:creator>
      <dc:date>2018-03-08T21:44:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize stats using simple math?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342792#M101539</link>
      <description>&lt;P&gt;Please accept the answer if this helped you&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 00:38:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342792#M101539</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-03-09T00:38:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize stats using simple math?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342793#M101540</link>
      <description>&lt;P&gt;This answer is very helpful and I've upvoted the answer - thank you! However, as it stands, both answers are equally valid, so I'm leaving it to the community to vote on them. &lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 18:38:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342793#M101540</guid>
      <dc:creator>flow2k</dc:creator>
      <dc:date>2018-03-09T18:38:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize stats using simple math?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342794#M101541</link>
      <description>&lt;P&gt;In the Splunk community, users accept answers that helped them solve their problem. This signals a correct answer for users who may look at this in the future. Since both answers are valid, it's fair to accept the one that helped more and/or who answered first, which in this case is this one. &lt;/P&gt;

&lt;P&gt;Top contributors on this forum would also be reluctant to answer your future questions if your known not to accept the correct answers&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 19:10:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342794#M101541</guid>
      <dc:creator>skoelpin</dc:creator>
      <dc:date>2018-03-09T19:10:19Z</dc:date>
    </item>
    <item>
      <title>Re: How to customize stats using simple math?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342795#M101542</link>
      <description>&lt;P&gt;I downvoted this post because refusing to accept a correct answer leaves unanswered spam on the board.&lt;/P&gt;</description>
      <pubDate>Fri, 09 Mar 2018 22:04:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-customize-stats-using-simple-math/m-p/342795#M101542</guid>
      <dc:creator>davpx</dc:creator>
      <dc:date>2018-03-09T22:04:04Z</dc:date>
    </item>
  </channel>
</rss>

