<?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 implement math calculations? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-implement-math-calculations/m-p/223496#M188250</link>
    <description>&lt;P&gt;Hey, Fellow Splunkers&lt;/P&gt;

&lt;P&gt;I'm curious to know if it's possible to preform math calculations on a set of "refined" data; for example: &lt;/P&gt;

&lt;P&gt;Let's say I extracted a field that presents the values of a gigabit into megabit? meaning I have 5 gig it would then be converted into 5120. &lt;BR /&gt;
so ideally I would like to take an entire field of data and multiple it by 1024? and have that information be presented when I call the field into a table?&lt;/P&gt;

&lt;P&gt;intial &lt;BR /&gt;
5gb&lt;BR /&gt;
4gb&lt;BR /&gt;
3gb&lt;/P&gt;

&lt;P&gt;output &lt;BR /&gt;
5120mb&lt;BR /&gt;
4096mb&lt;BR /&gt;
3072mb &lt;/P&gt;</description>
    <pubDate>Fri, 12 Aug 2016 01:22:33 GMT</pubDate>
    <dc:creator>asarran</dc:creator>
    <dc:date>2016-08-12T01:22:33Z</dc:date>
    <item>
      <title>How to implement math calculations?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-implement-math-calculations/m-p/223496#M188250</link>
      <description>&lt;P&gt;Hey, Fellow Splunkers&lt;/P&gt;

&lt;P&gt;I'm curious to know if it's possible to preform math calculations on a set of "refined" data; for example: &lt;/P&gt;

&lt;P&gt;Let's say I extracted a field that presents the values of a gigabit into megabit? meaning I have 5 gig it would then be converted into 5120. &lt;BR /&gt;
so ideally I would like to take an entire field of data and multiple it by 1024? and have that information be presented when I call the field into a table?&lt;/P&gt;

&lt;P&gt;intial &lt;BR /&gt;
5gb&lt;BR /&gt;
4gb&lt;BR /&gt;
3gb&lt;/P&gt;

&lt;P&gt;output &lt;BR /&gt;
5120mb&lt;BR /&gt;
4096mb&lt;BR /&gt;
3072mb &lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 01:22:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-implement-math-calculations/m-p/223496#M188250</guid>
      <dc:creator>asarran</dc:creator>
      <dc:date>2016-08-12T01:22:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement math calculations?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-implement-math-calculations/m-p/223497#M188251</link>
      <description>&lt;P&gt;Hi asarran,&lt;/P&gt;

&lt;P&gt;take a look at the docs about the &lt;CODE&gt;convert&lt;/CODE&gt; command &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Convert"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Convert&lt;/A&gt; and its option &lt;CODE&gt;memk()&lt;/CODE&gt;.&lt;BR /&gt;
But to answer your question, math calculation can be made with the &lt;CODE&gt;eval&lt;/CODE&gt; command &lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval&lt;/A&gt; using the Arithmetic operators.&lt;/P&gt;

&lt;P&gt;Hope this helps ...&lt;/P&gt;

&lt;P&gt;cheers, MuS &lt;/P&gt;</description>
      <pubDate>Fri, 12 Aug 2016 01:26:57 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-implement-math-calculations/m-p/223497#M188251</guid>
      <dc:creator>MuS</dc:creator>
      <dc:date>2016-08-12T01:26:57Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement math calculations?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-implement-math-calculations/m-p/223498#M188252</link>
      <description>&lt;P&gt;Eval is your friend...&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | eval output=initial*1024
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Or in this case you'd have to get the number first with Rex&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;  | rex field=initial "(?&amp;lt;gb&amp;gt;\d+)" | eval output=gb*1024
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 Aug 2016 01:27:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-implement-math-calculations/m-p/223498#M188252</guid>
      <dc:creator>jkat54</dc:creator>
      <dc:date>2016-08-12T01:27:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to implement math calculations?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-implement-math-calculations/m-p/223499#M188253</link>
      <description>&lt;P&gt;hey, thx&lt;/P&gt;

&lt;P&gt;the answer was correct, however it was off by a bit had to enter another \d +\d for other decimal values. &lt;/P&gt;

&lt;P&gt;I greatly appreciate your response, &lt;/P&gt;

&lt;P&gt;thank you, asarran &lt;/P&gt;</description>
      <pubDate>Mon, 15 Aug 2016 21:10:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-implement-math-calculations/m-p/223499#M188253</guid>
      <dc:creator>asarran</dc:creator>
      <dc:date>2016-08-15T21:10:48Z</dc:date>
    </item>
  </channel>
</rss>

