<?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: calculate percentage of a each ErrorCode field by servername in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/calculate-percentage-of-a-each-ErrorCode-field-by-servername/m-p/569889#M198630</link>
    <description>&lt;LI-CODE lang="markup"&gt;index="my_index"
| rex field=source "\/log\.(?&amp;lt;servername&amp;gt;\w+)."
| rex "Err\-ErrorCode\[(?&amp;lt;ErrorCode&amp;gt;\d+)"
| eventstats count as servercount by servername
| stats count as errorcount values(servercount) as servercount by servername ErrorCode
| eval Percentage=round(100*errorcount/servercount,2)
| table servername ErrorCode Percentage&lt;/LI-CODE&gt;</description>
    <pubDate>Wed, 06 Oct 2021 13:29:12 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2021-10-06T13:29:12Z</dc:date>
    <item>
      <title>calculate percentage of a each ErrorCode field by servername</title>
      <link>https://community.splunk.com/t5/Splunk-Search/calculate-percentage-of-a-each-ErrorCode-field-by-servername/m-p/569874#M198625</link>
      <description>&lt;P class="lia-align-left"&gt;Hi&lt;/P&gt;&lt;P&gt;how can I calculate percentage of a each ErrorCode field by servername?&lt;/P&gt;&lt;P&gt;here is the spl:&lt;/P&gt;&lt;P&gt;index="my_index"&lt;BR /&gt;| rex field=source "\/log\.(?&amp;lt;servername&amp;gt;\w+)."&lt;BR /&gt;| rex "Err\-ErrorCode\[(?&amp;lt;ErrorCode&amp;gt;\d+)"&lt;BR /&gt;&lt;BR /&gt;expected output:&lt;/P&gt;&lt;P&gt;Servername &amp;nbsp; &amp;nbsp;&amp;nbsp;ErrorCode &amp;nbsp; &amp;nbsp; &amp;nbsp;Percentage&amp;nbsp;&lt;/P&gt;&lt;P&gt;server1 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 404 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50%&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;500&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 40%&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;200 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10%&lt;/P&gt;&lt;P&gt;server2 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 500 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50%&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;404 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;45%&lt;/P&gt;&lt;P&gt;&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;200 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;5%&lt;/P&gt;&lt;P&gt;…&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;any idea?&lt;/P&gt;&lt;P&gt;&amp;nbsp;Thanks&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 12:54:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/calculate-percentage-of-a-each-ErrorCode-field-by-servername/m-p/569874#M198625</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-10-06T12:54:17Z</dc:date>
    </item>
    <item>
      <title>Re: calculate percentage of a each ErrorCode field by servername</title>
      <link>https://community.splunk.com/t5/Splunk-Search/calculate-percentage-of-a-each-ErrorCode-field-by-servername/m-p/569889#M198630</link>
      <description>&lt;LI-CODE lang="markup"&gt;index="my_index"
| rex field=source "\/log\.(?&amp;lt;servername&amp;gt;\w+)."
| rex "Err\-ErrorCode\[(?&amp;lt;ErrorCode&amp;gt;\d+)"
| eventstats count as servercount by servername
| stats count as errorcount values(servercount) as servercount by servername ErrorCode
| eval Percentage=round(100*errorcount/servercount,2)
| table servername ErrorCode Percentage&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Oct 2021 13:29:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/calculate-percentage-of-a-each-ErrorCode-field-by-servername/m-p/569889#M198630</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-06T13:29:12Z</dc:date>
    </item>
    <item>
      <title>Re: calculate percentage of a each ErrorCode field by servername</title>
      <link>https://community.splunk.com/t5/Splunk-Search/calculate-percentage-of-a-each-ErrorCode-field-by-servername/m-p/569897#M198634</link>
      <description>&lt;P&gt;Thank you for answer, is it possible to add count, like below?&lt;/P&gt;&lt;P&gt;Servername &amp;nbsp; &amp;nbsp;&amp;nbsp;ErrorCode &amp;nbsp; &amp;nbsp; &amp;nbsp;Percentage&amp;nbsp; &amp;nbsp; &amp;nbsp; count&lt;/P&gt;&lt;P&gt;server1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;404 &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;50%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;456&lt;/P&gt;</description>
      <pubDate>Wed, 06 Oct 2021 14:03:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/calculate-percentage-of-a-each-ErrorCode-field-by-servername/m-p/569897#M198634</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-10-06T14:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: calculate percentage of a each ErrorCode field by servername</title>
      <link>https://community.splunk.com/t5/Splunk-Search/calculate-percentage-of-a-each-ErrorCode-field-by-servername/m-p/569899#M198635</link>
      <description>&lt;P&gt;Just add it to the table command&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| table servername ErrorCode Percentage errorcount&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 06 Oct 2021 14:08:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/calculate-percentage-of-a-each-ErrorCode-field-by-servername/m-p/569899#M198635</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2021-10-06T14:08:35Z</dc:date>
    </item>
  </channel>
</rss>

