<?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 perfom math calculations in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-perfom-math-calculations/m-p/186291#M53662</link>
    <description>&lt;P&gt;I am trying to figure out how to take two searches and divide their results to create a dial chart showing the percentage of breached records. &lt;/P&gt;

&lt;P&gt;index=itsm sourcetype=sm9_incident | dedup NUMBER | search assignmentGroup="WG1555" AND isBreached="t" AND status="Closed" |stats count&lt;/P&gt;

&lt;P&gt;index=itsm sourcetype=sm9_incident | dedup NUMBER | search assignmentGroup="WG1555" AND status="Closed" | stats count&lt;/P&gt;</description>
    <pubDate>Thu, 13 Mar 2014 14:41:10 GMT</pubDate>
    <dc:creator>bvenom28</dc:creator>
    <dc:date>2014-03-13T14:41:10Z</dc:date>
    <item>
      <title>How to perfom math calculations</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-perfom-math-calculations/m-p/186291#M53662</link>
      <description>&lt;P&gt;I am trying to figure out how to take two searches and divide their results to create a dial chart showing the percentage of breached records. &lt;/P&gt;

&lt;P&gt;index=itsm sourcetype=sm9_incident | dedup NUMBER | search assignmentGroup="WG1555" AND isBreached="t" AND status="Closed" |stats count&lt;/P&gt;

&lt;P&gt;index=itsm sourcetype=sm9_incident | dedup NUMBER | search assignmentGroup="WG1555" AND status="Closed" | stats count&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 14:41:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-perfom-math-calculations/m-p/186291#M53662</guid>
      <dc:creator>bvenom28</dc:creator>
      <dc:date>2014-03-13T14:41:10Z</dc:date>
    </item>
    <item>
      <title>Re: How to perfom math calculations</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-perfom-math-calculations/m-p/186292#M53663</link>
      <description>&lt;P&gt;Hi bvenom28,&lt;/P&gt;

&lt;P&gt;try something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=itsm sourcetype=sm9_incident assignmentGroup="WG1555" | dedup NUMBER | eventstats count(eval(isBreached="t" AND status="Closed")) as isBreachedCount count(eval(status="Closed")) as ClosedCount | eval myPrec=isBreachedCount*100/ClosedCount | table myPrec
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;cheers, MuS&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 14:52:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-perfom-math-calculations/m-p/186292#M53663</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2014-03-13T14:52:58Z</dc:date>
    </item>
    <item>
      <title>Re: How to perfom math calculations</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-perfom-math-calculations/m-p/186293#M53664</link>
      <description>&lt;P&gt;Wow that worked perfect. I have alot to learn. Thanks!!!!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 15:02:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-perfom-math-calculations/m-p/186293#M53664</guid>
      <dc:creator>bvenom28</dc:creator>
      <dc:date>2014-03-13T15:02:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to perfom math calculations</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-perfom-math-calculations/m-p/186294#M53665</link>
      <description>&lt;P&gt;bvenom28, i recommend you check out the search and reporting class offered by the Splunk EDU team, it's a good way to get started!&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 15:51:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-perfom-math-calculations/m-p/186294#M53665</guid>
      <dc:creator>piebob</dc:creator>
      <dc:date>2014-03-13T15:51:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to perfom math calculations</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-perfom-math-calculations/m-p/186295#M53666</link>
      <description>&lt;P&gt;bvenom28,&lt;/P&gt;

&lt;P&gt;your searches where really not well formed:&lt;/P&gt;

&lt;P&gt;index=itsm sourcetype=sm9_incident | dedup NUMBER | search assignmentGroup="WG1555" AND isBreached="t" AND status="Closed" |stats count&lt;/P&gt;

&lt;P&gt;The search terms should always be places at the beginning of the search, unless you really need to filter out results based on same valued calculated in a stats or eval statement.&lt;/P&gt;

&lt;P&gt;As correctly MuS wrote, the assignmentGroup="WG1555" condition has been placed right at the beginning, and he wisely used the "count(eval('condition')) trick to summarize values of events matching a certain condition.&lt;/P&gt;

&lt;P&gt;marco&lt;/P&gt;</description>
      <pubDate>Thu, 13 Mar 2014 16:06:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-perfom-math-calculations/m-p/186295#M53666</guid>
      <dc:creator>marcoscala</dc:creator>
      <dc:date>2014-03-13T16:06:26Z</dc:date>
    </item>
  </channel>
</rss>

