<?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 reuse the count from a previous search to calculate a percentage in a second search or combine the two searches? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122549#M33020</link>
    <description>&lt;P&gt;Are you satisfied by my previous answer ? If yes let vote it&lt;/P&gt;</description>
    <pubDate>Tue, 07 Apr 2015 09:59:51 GMT</pubDate>
    <dc:creator>chimell</dc:creator>
    <dc:date>2015-04-07T09:59:51Z</dc:date>
    <item>
      <title>How to reuse the count from a previous search to calculate a percentage in a second search or combine the two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122542#M33013</link>
      <description>&lt;P&gt;Hi, &lt;/P&gt;

&lt;P&gt;I want to create a dashboard using these 2 searches:&lt;BR /&gt;
1)  the first one &lt;CODE&gt;index='text' | count&lt;/CODE&gt;, will give a result. For example &lt;STRONG&gt;result&lt;/STRONG&gt;=250&lt;BR /&gt;
2)  the second one will be based on the result of the first one&lt;BR /&gt;
index='text'  type='cpu'| eventstats sum(nombre) as total | eval pourcentage=round((nombre/&lt;STRONG&gt;result&lt;/STRONG&gt;)*100,2) | table EventType, nombre, pourcentage&lt;/P&gt;

&lt;P&gt;Do you have an idea how to do this? &lt;BR /&gt;
Thank you all, have a nice day&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2015 07:56:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122542#M33013</guid>
      <dc:creator>otman01</dc:creator>
      <dc:date>2015-04-03T07:56:24Z</dc:date>
    </item>
    <item>
      <title>Re: How to reuse the count from a previous search to calculate a percentage in a second search or combine the two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122543#M33014</link>
      <description>&lt;P&gt;Hi, Otman01&lt;BR /&gt;
 try this:&lt;BR /&gt;
index='text'|count AS result [search index='text' type='cpu'| eventstats sum(nombre) as total ]| eval pourcentage=round((nombre/result)*100,2) | table EventType, nombre, pourcentage &lt;/P&gt;

&lt;P&gt;Thanks to vote and Accept if your are satisfied....&lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2015 08:52:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122543#M33014</guid>
      <dc:creator>stephane_cyrill</dc:creator>
      <dc:date>2015-04-03T08:52:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to reuse the count from a previous search to calculate a percentage in a second search or combine the two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122544#M33015</link>
      <description>&lt;P&gt;I have some problems in the 2 searchs. can you help me ? thank you &lt;BR /&gt;
"Error in 'chart' command: The argument '( ( EventType=0 AND count=7957 ) )' is invalid."&lt;/P&gt;

&lt;P&gt;this is exactely the first search: &lt;BR /&gt;
source="WinEventLog:*"   | chart count AS result&lt;/P&gt;

&lt;P&gt;this is the second:&lt;BR /&gt;
search source="WinEventLog:*" EventType=0 | chart count    by EventType &lt;/P&gt;

&lt;P&gt;in the general search I do like bellow (it works to give me the percentage)&lt;/P&gt;

&lt;P&gt;source="WinEventLog:*" | chart count  as nombre by EventType | eventstats sum(nombre) as total | eval percentage=round((nombre/total)*100,2) | table EventType, nombre, percentage&lt;/P&gt;

&lt;P&gt;but I want to keep each row in a separate panel .&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:23:13 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122544#M33015</guid>
      <dc:creator>otman01</dc:creator>
      <dc:date>2020-09-28T19:23:13Z</dc:date>
    </item>
    <item>
      <title>Re: How to reuse the count from a previous search to calculate a percentage in a second search or combine the two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122545#M33016</link>
      <description>&lt;P&gt;Yes EventType  is a field for me there are a values that it accept (0.1.2.3.4.5.6) &lt;BR /&gt;
thank you &lt;/P&gt;</description>
      <pubDate>Fri, 03 Apr 2015 13:31:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122545#M33016</guid>
      <dc:creator>otman01</dc:creator>
      <dc:date>2015-04-03T13:31:30Z</dc:date>
    </item>
    <item>
      <title>Re: How to reuse the count from a previous search to calculate a percentage in a second search or combine the two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122546#M33017</link>
      <description>&lt;P&gt;Hi otman01 &lt;BR /&gt;
Try this xml code &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;    &amp;lt;dashboard&amp;gt;
      &amp;lt;label&amp;gt;fcff&amp;lt;/label&amp;gt;
      &amp;lt;row&amp;gt;
        &amp;lt;panel&amp;gt;
          &amp;lt;chart&amp;gt;
            &amp;lt;search&amp;gt;
              &amp;lt;query&amp;gt;source="WinEventLog:*" | chart count AS result&amp;lt;/query&amp;gt;
              &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
              &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
            &amp;lt;/search&amp;gt;
          &amp;lt;/chart&amp;gt;
        &amp;lt;/panel&amp;gt;
      &amp;lt;/row&amp;gt;
    &amp;lt;row&amp;gt;
        &amp;lt;panel&amp;gt;
          &amp;lt;chart&amp;gt;
            &amp;lt;search&amp;gt;
              &amp;lt;query&amp;gt; source="WinEventLog:*" EventType=0 | chart count by EventType &amp;lt;/query&amp;gt;
              &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
              &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
            &amp;lt;/search&amp;gt;
          &amp;lt;/chart&amp;gt;
        &amp;lt;/panel&amp;gt;
      &amp;lt;/row&amp;gt;
    &amp;lt;row&amp;gt;
        &amp;lt;panel&amp;gt;
          &amp;lt;chart&amp;gt;
            &amp;lt;search&amp;gt;
              &amp;lt;query&amp;gt; source="WinEventLog:*" | chart count as nombre by EventType | eventstats sum(nombre) as total | eval percentage=round((nombre/total)*100,2) | table EventType, nombre, percentage &amp;lt;/query&amp;gt;
              &amp;lt;earliest&amp;gt;0&amp;lt;/earliest&amp;gt;
              &amp;lt;latest&amp;gt;now&amp;lt;/latest&amp;gt;
            &amp;lt;/search&amp;gt;
          &amp;lt;/chart&amp;gt;
        &amp;lt;/panel&amp;gt;
      &amp;lt;/row&amp;gt;
    &amp;lt;/dashboard&amp;gt;
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Sat, 04 Apr 2015 11:43:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122546#M33017</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2015-04-04T11:43:25Z</dc:date>
    </item>
    <item>
      <title>Re: How to reuse the count from a previous search to calculate a percentage in a second search or combine the two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122547#M33018</link>
      <description>&lt;P&gt;Thank you for your answer.&lt;BR /&gt;
so this is an extrat of the result that the search return:&lt;BR /&gt;
EventType--------nombre        ------------------- percentage&lt;BR /&gt;
0------------------- 8246          ----------------------- 14.43&lt;BR /&gt;
1     ------------------- 18                 --------------------------- 0.03&lt;BR /&gt;
2             ------------------- 7512  -----------------------               13.15&lt;BR /&gt;
3      ------------------- 3982         ------------------------ 6.97&lt;BR /&gt;
4    ------------------- 37286           ---------------------- 65.25&lt;BR /&gt;
5   ------------------- 101             -------------------------- 0.18&lt;/P&gt;

&lt;P&gt;What I want to do is extract for example the 2nd row and the 4th row .&lt;BR /&gt;
Is this is &lt;STRONG&gt;POSSIBLE&lt;/STRONG&gt; ? &lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 08:08:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122547#M33018</guid>
      <dc:creator>otman01</dc:creator>
      <dc:date>2015-04-07T08:08:02Z</dc:date>
    </item>
    <item>
      <title>Re: How to reuse the count from a previous search to calculate a percentage in a second search or combine the two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122548#M33019</link>
      <description>&lt;P&gt;Thank you I could find another solution, for my case I use  &lt;STRONG&gt;WHERE&lt;/STRONG&gt; &lt;STRONG&gt;expression&lt;/STRONG&gt; to extrat just one line&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 09:50:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122548#M33019</guid>
      <dc:creator>otman01</dc:creator>
      <dc:date>2015-04-07T09:50:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to reuse the count from a previous search to calculate a percentage in a second search or combine the two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122549#M33020</link>
      <description>&lt;P&gt;Are you satisfied by my previous answer ? If yes let vote it&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 09:59:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122549#M33020</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2015-04-07T09:59:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to reuse the count from a previous search to calculate a percentage in a second search or combine the two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122550#M33021</link>
      <description>&lt;P&gt;Hi otman01&lt;BR /&gt;
Just follow this  link ,it will help you&lt;BR /&gt;
&lt;A href="http://answers.splunk.com/answers/169069/extract-one-row-of-data-from-a-table.html"&gt;http://answers.splunk.com/answers/169069/extract-one-row-of-data-from-a-table.html&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 07 Apr 2015 10:47:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122550#M33021</guid>
      <dc:creator>chimell</dc:creator>
      <dc:date>2015-04-07T10:47:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to reuse the count from a previous search to calculate a percentage in a second search or combine the two searches?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122551#M33022</link>
      <description>&lt;P&gt;Hi @otman01&lt;/P&gt;

&lt;P&gt;Please be sure than when responding to someone's answer, click on "Add comment" directly below their answer or, if responding to someone's comment, type in the "Add your comment..." box directly below their comment. You keep typing your responses in the "Enter your answer here..." box at the very bottom of the page which, instead, posts a brand new answer when it was really meant as a comment. This will help with a clean continuous flow of the conversation. It gets difficult when people don't know who you're responding to. I already converted your answer to a comment, so just something to keep in mind from here on out. Thanks &lt;/P&gt;</description>
      <pubDate>Thu, 09 Apr 2015 22:09:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-reuse-the-count-from-a-previous-search-to-calculate-a/m-p/122551#M33022</guid>
      <dc:creator>ppablo</dc:creator>
      <dc:date>2015-04-09T22:09:07Z</dc:date>
    </item>
  </channel>
</rss>

