<?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 use plus sign before a result to calculate percentage? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-plus-sign-before-a-result-to-calculate-percentage/m-p/436702#M124435</link>
    <description>&lt;P&gt;perfect thanks&lt;/P&gt;</description>
    <pubDate>Mon, 11 Mar 2019 12:21:17 GMT</pubDate>
    <dc:creator>jip31</dc:creator>
    <dc:date>2019-03-11T12:21:17Z</dc:date>
    <item>
      <title>How to use plus sign before a result to calculate percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-plus-sign-before-a-result-to-calculate-percentage/m-p/436698#M124431</link>
      <description>&lt;P&gt;Hello&lt;BR /&gt;
I use the eval below in order to calculate a percentage&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| eval Trend_Proc_time=round(100-(Proc_dest*100)/(Proc_source),1)." %" 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;When Proc_dest is &amp;gt; to  Proc_source I have a result with minus - perfect&lt;BR /&gt;
But when Proc_dest is &amp;lt; to Proc_source, I need to have a + sign before the result&lt;BR /&gt;
could you help me to do this please?&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 23:40:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-plus-sign-before-a-result-to-calculate-percentage/m-p/436698#M124431</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2020-09-29T23:40:33Z</dc:date>
    </item>
    <item>
      <title>Re: How to use plus sign before a result to calculate percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-plus-sign-before-a-result-to-calculate-percentage/m-p/436699#M124432</link>
      <description>&lt;P&gt;Hi&lt;/P&gt;

&lt;P&gt;Try like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;your query| eval Trend_Proc_time=round(100-(Proc_dest*100)/(Proc_source),1) 
    | eval Trend_Proc_time=if(Trend_Proc_time&amp;gt;0,"+".Trend_Proc_time." %",Trend_Proc_time." %")
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Mar 2019 11:21:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-plus-sign-before-a-result-to-calculate-percentage/m-p/436699#M124432</guid>
      <dc:creator>vnravikumar</dc:creator>
      <dc:date>2019-03-11T11:21:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to use plus sign before a result to calculate percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-plus-sign-before-a-result-to-calculate-percentage/m-p/436700#M124433</link>
      <description>&lt;P&gt;Hi. &lt;BR /&gt;
Using regex/sed you could try this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...| eval Trend_Proc_time=round(100-(Proc_dest*100)/(Proc_source),1)." %" 
   |rex mode=sed field=Trend_Proc_time "s/^(\d+)/+\1/"
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 11 Mar 2019 11:34:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-plus-sign-before-a-result-to-calculate-percentage/m-p/436700#M124433</guid>
      <dc:creator>nickhills</dc:creator>
      <dc:date>2019-03-11T11:34:31Z</dc:date>
    </item>
    <item>
      <title>Re: How to use plus sign before a result to calculate percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-plus-sign-before-a-result-to-calculate-percentage/m-p/436701#M124434</link>
      <description>&lt;P&gt;sorry it doesnt works&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 12:21:06 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-plus-sign-before-a-result-to-calculate-percentage/m-p/436701#M124434</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-03-11T12:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: How to use plus sign before a result to calculate percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-use-plus-sign-before-a-result-to-calculate-percentage/m-p/436702#M124435</link>
      <description>&lt;P&gt;perfect thanks&lt;/P&gt;</description>
      <pubDate>Mon, 11 Mar 2019 12:21:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-use-plus-sign-before-a-result-to-calculate-percentage/m-p/436702#M124435</guid>
      <dc:creator>jip31</dc:creator>
      <dc:date>2019-03-11T12:21:17Z</dc:date>
    </item>
  </channel>
</rss>

