<?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 Is the following calculation possible ? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438321#M124763</link>
    <description>&lt;P&gt;I'm currently generating an AvgTime of processing cycles in a thread within a 5 min duration and writing these out to a log similar to this&lt;/P&gt;

&lt;P&gt;[PrepareEvents, DispatchAll]&lt;/P&gt;

&lt;P&gt;PrepareEvents      samples  Avg: 2757ns;  Median: 1411ns;  Max: 1533433ns; Total Events: 277138; Total Items: 314155&lt;/P&gt;

&lt;P&gt;I want to perform the following calculation so i find out how many average ns i've spent processing cycles in the 5min duration&lt;/P&gt;

&lt;P&gt;avgTime  (multiply i cant add star here) Total items * 100 / (5 min in nanos&lt;/P&gt;

&lt;P&gt;Can i do this in splunk ? &lt;/P&gt;</description>
    <pubDate>Thu, 31 Jan 2019 10:38:15 GMT</pubDate>
    <dc:creator>luckyman80</dc:creator>
    <dc:date>2019-01-31T10:38:15Z</dc:date>
    <item>
      <title>Is the following calculation possible ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438321#M124763</link>
      <description>&lt;P&gt;I'm currently generating an AvgTime of processing cycles in a thread within a 5 min duration and writing these out to a log similar to this&lt;/P&gt;

&lt;P&gt;[PrepareEvents, DispatchAll]&lt;/P&gt;

&lt;P&gt;PrepareEvents      samples  Avg: 2757ns;  Median: 1411ns;  Max: 1533433ns; Total Events: 277138; Total Items: 314155&lt;/P&gt;

&lt;P&gt;I want to perform the following calculation so i find out how many average ns i've spent processing cycles in the 5min duration&lt;/P&gt;

&lt;P&gt;avgTime  (multiply i cant add star here) Total items * 100 / (5 min in nanos&lt;/P&gt;

&lt;P&gt;Can i do this in splunk ? &lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 10:38:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438321#M124763</guid>
      <dc:creator>luckyman80</dc:creator>
      <dc:date>2019-01-31T10:38:15Z</dc:date>
    </item>
    <item>
      <title>Re: Is the following calculation possible ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438322#M124764</link>
      <description>&lt;P&gt;Hi @luckyman80 &lt;/P&gt;

&lt;P&gt;Does this do what you need: &lt;CODE&gt;&amp;lt;your search&amp;gt; | rex "Avg:\s*(?&amp;lt;avg&amp;gt;\d+)ns;\s*Median:\s*(?&amp;lt;median&amp;gt;\d+)ns;\s*Max:\s*(?&amp;lt;max&amp;gt;\d+)ns;\s*Total Events:\s*(?&amp;lt;total_events&amp;gt;\d+);\s*Total Items:\s*(?&amp;lt;total_items&amp;gt;\d+)" | eval result = (avg * total_items) / 300000000000&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;All the best, Chris.&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 10:47:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438322#M124764</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-01-31T10:47:43Z</dc:date>
    </item>
    <item>
      <title>Re: Is the following calculation possible ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438323#M124765</link>
      <description>&lt;P&gt;Hi Chris, Thanks for your prompt response. How do I show the result from the calculation only ? &lt;/P&gt;

&lt;P&gt;Thanks again&lt;/P&gt;

&lt;P&gt;Paul &lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 11:10:00 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438323#M124765</guid>
      <dc:creator>luckyman80</dc:creator>
      <dc:date>2019-01-31T11:10:00Z</dc:date>
    </item>
    <item>
      <title>Re: Is the following calculation possible ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438324#M124766</link>
      <description>&lt;P&gt;Hi Paul&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;your search&amp;gt; | rex "Avg:\s*(?&amp;lt;avg&amp;gt;\d+)ns;\s*Median:\s*(?&amp;lt;median&amp;gt;\d+)ns;\s*Max:\s*(?&amp;lt;max&amp;gt;\d+)ns;\s*Total Events:\s*(?&amp;lt;total_events&amp;gt;\d+);\s*Total Items:\s*(?&amp;lt;total_items&amp;gt;\d+)" | eval result = (avg * total_items) / 300000000000 | table result&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 11:13:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438324#M124766</guid>
      <dc:creator>chrisyounger</dc:creator>
      <dc:date>2019-01-31T11:13:53Z</dc:date>
    </item>
    <item>
      <title>Re: Is the following calculation possible ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438325#M124767</link>
      <description>&lt;P&gt;just add a &lt;CODE&gt;|table result&lt;/CODE&gt; to the search Chris provided!&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 11:14:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438325#M124767</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-01-31T11:14:51Z</dc:date>
    </item>
    <item>
      <title>Re: Is the following calculation possible ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438326#M124768</link>
      <description>&lt;P&gt;Thanks guys this looks good one last ask .. sorry for all the questions.. do you know how to turn the result into a percentage rather then raw value  ?&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 11:21:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438326#M124768</guid>
      <dc:creator>luckyman80</dc:creator>
      <dc:date>2019-01-31T11:21:03Z</dc:date>
    </item>
    <item>
      <title>Re: Is the following calculation possible ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438327#M124769</link>
      <description>&lt;P&gt;actually i see the issue. it seems the percentage calculation is missing from your first example &lt;/P&gt;

&lt;P&gt;Total items * 100&lt;/P&gt;

&lt;P&gt;how do I make this a percentage ? &lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 11:32:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438327#M124769</guid>
      <dc:creator>luckyman80</dc:creator>
      <dc:date>2019-01-31T11:32:33Z</dc:date>
    </item>
    <item>
      <title>Re: Is the following calculation possible ?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438328#M124770</link>
      <description>&lt;P&gt;If you just need the results to be displayed as a percentage you can add a &lt;CODE&gt;| eval result = result." %"&lt;/CODE&gt; to the search string.&lt;/P&gt;

&lt;P&gt;This can even be used for rounding down if needed: &lt;CODE&gt;|eval result = round(result,2)." %"&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 31 Jan 2019 11:42:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Is-the-following-calculation-possible/m-p/438328#M124770</guid>
      <dc:creator>DMohn</dc:creator>
      <dc:date>2019-01-31T11:42:11Z</dc:date>
    </item>
  </channel>
</rss>

