<?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: extract percentage of code by servername in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/extract-percentage-of-code-by-servername/m-p/571042#M198984</link>
    <description>&lt;P&gt;the question that you mention is different that with my question.&lt;/P&gt;&lt;P&gt;any idea?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 14 Oct 2021 19:01:23 GMT</pubDate>
    <dc:creator>indeed_2000</dc:creator>
    <dc:date>2021-10-14T19:01:23Z</dc:date>
    <item>
      <title>extract percentage of code by servername</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-percentage-of-code-by-servername/m-p/571016#M198978</link>
      <description>&lt;P&gt;Hi&lt;BR /&gt;i have two field "servername" "code". i need to extract percent of code by servers.&lt;/P&gt;&lt;P&gt;index="my-index" | table servername code&lt;/P&gt;&lt;P&gt;expected output:&lt;BR /&gt;servername code percent count&lt;BR /&gt;server1&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;404&amp;nbsp; &amp;nbsp; 50%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; 50&lt;BR /&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; 40%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;40&lt;BR /&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; 401&amp;nbsp; &amp;nbsp; 10%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;10&lt;BR /&gt;server2&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;404&amp;nbsp; &amp;nbsp; &amp;nbsp;55%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;55&lt;BR /&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;30%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;30&lt;BR /&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; 401&amp;nbsp; &amp;nbsp; 15%&amp;nbsp; &amp;nbsp; &amp;nbsp; &amp;nbsp;15&lt;/P&gt;&lt;P&gt;any idea?&lt;BR /&gt;thanks&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 16:08:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-percentage-of-code-by-servername/m-p/571016#M198978</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-10-14T16:08:15Z</dc:date>
    </item>
    <item>
      <title>Re: extract percentage of code by servername</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-percentage-of-code-by-servername/m-p/571040#M198982</link>
      <description>&lt;P&gt;Hi &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/217339"&gt;@indeed_2000&lt;/a&gt; ! It's often a good idea to search the community for answers before asking the question. In this case, I found exactly an answer in only one search:&lt;/P&gt;&lt;P&gt;&lt;A href="https://community.splunk.com/t5/Splunk-Search/How-to-get-the-percentage-of-each-HTTP-status-code/td-p/420708" target="_blank"&gt;https://community.splunk.com/t5/Splunk-Search/How-to-get-the-percentage-of-each-HTTP-status-code/td-p/420708&lt;/A&gt;&lt;/P&gt;&lt;P&gt;If this resolves your problem, please accept this answer.&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 18:20:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-percentage-of-code-by-servername/m-p/571040#M198982</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2021-10-14T18:20:56Z</dc:date>
    </item>
    <item>
      <title>Re: extract percentage of code by servername</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-percentage-of-code-by-servername/m-p/571042#M198984</link>
      <description>&lt;P&gt;the question that you mention is different that with my question.&lt;/P&gt;&lt;P&gt;any idea?&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 19:01:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-percentage-of-code-by-servername/m-p/571042#M198984</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-10-14T19:01:23Z</dc:date>
    </item>
    <item>
      <title>Re: extract percentage of code by servername</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-percentage-of-code-by-servername/m-p/571046#M198986</link>
      <description>&lt;P&gt;after several try finally find solution, here is the solution:&lt;/P&gt;&lt;P&gt;index="my-index" err* |&lt;/P&gt;&lt;P&gt;| fields code, servername&lt;BR /&gt;| stats count(code) as totalCount by servername, code&lt;BR /&gt;| eventstats sum(totalCount) as _total&lt;BR /&gt;| eventstats sum(totalCount) as _totalPerServer by servername&lt;BR /&gt;| eval percentageTotal=round((totalCount/_total)*100,2)&lt;BR /&gt;| eval precentagePerServer=round((totalCount/_totalPerServer)*100,2)&lt;BR /&gt;| stats list(code) as code list(precentagePerServer) as percentageTotal list(totalCount) by servername&lt;BR /&gt;| sort - totalCount&lt;/P&gt;</description>
      <pubDate>Thu, 14 Oct 2021 19:51:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-percentage-of-code-by-servername/m-p/571046#M198986</guid>
      <dc:creator>indeed_2000</dc:creator>
      <dc:date>2021-10-14T19:51:58Z</dc:date>
    </item>
    <item>
      <title>Re: extract percentage of code by servername</title>
      <link>https://community.splunk.com/t5/Splunk-Search/extract-percentage-of-code-by-servername/m-p/571561#M199168</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/217339"&gt;@indeed_2000&lt;/a&gt;It looks like the solution you posted and accepted uses the code from the page I linked to. Glad it helped you. It looks like you've found that lines of SPL code may be useful for multiple use cases.&lt;BR /&gt;If the pointer I provided was helpful, a karma thumbs up is appreciated.&lt;BR /&gt;Happy Splunking!&lt;/P&gt;</description>
      <pubDate>Tue, 19 Oct 2021 21:44:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/extract-percentage-of-code-by-servername/m-p/571561#M199168</guid>
      <dc:creator>efavreau</dc:creator>
      <dc:date>2021-10-19T21:44:09Z</dc:date>
    </item>
  </channel>
</rss>

