<?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: Timechart usind the percentage field in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-usind-the-percentage-field/m-p/411141#M118607</link>
    <description>&lt;P&gt;Your example search doesn't make a lot of sense to me.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats values(bytes) as bytes values(clientip) as clientip values(Time) as Time&lt;/CODE&gt;&lt;BR /&gt;
No by-clause, so this will result in a single row result (potentially with multi valued fields)&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| chart count OVER bytes&lt;/CODE&gt;&lt;BR /&gt;
This will result in a single count = 1, given that the previous part of the query was a single row result.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| eventstats sum(count) As total&lt;/CODE&gt;&lt;BR /&gt;
This will therefore also result in 1.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| eval percent=round((100*count/total),2)&lt;/CODE&gt;&lt;BR /&gt;
This would make sense if the count and total made sense.&lt;/P&gt;

&lt;P&gt;Can you please explain what percentage you want to calculate (and timechart)?&lt;/P&gt;</description>
    <pubDate>Wed, 27 Jun 2018 12:23:45 GMT</pubDate>
    <dc:creator>FrankVl</dc:creator>
    <dc:date>2018-06-27T12:23:45Z</dc:date>
    <item>
      <title>Timechart usind the percentage field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-usind-the-percentage-field/m-p/411140#M118606</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;

&lt;P&gt;I am trying to build a timechart but only using the "percent" field according to the example search below. Can anyone please help me?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;

&lt;P&gt;index=* source=*&lt;BR /&gt;
| stats values(bytes) as bytes values(clientip) as clientip values(Time) as Time&lt;BR /&gt;
| chart count OVER bytes &lt;BR /&gt;
| eventstats sum(count) As total &lt;BR /&gt;
| eval percent=round((100*count/total),2)&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 10:26:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-usind-the-percentage-field/m-p/411140#M118606</guid>
      <dc:creator>duygu</dc:creator>
      <dc:date>2018-06-27T10:26:01Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart usind the percentage field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-usind-the-percentage-field/m-p/411141#M118607</link>
      <description>&lt;P&gt;Your example search doesn't make a lot of sense to me.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| stats values(bytes) as bytes values(clientip) as clientip values(Time) as Time&lt;/CODE&gt;&lt;BR /&gt;
No by-clause, so this will result in a single row result (potentially with multi valued fields)&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| chart count OVER bytes&lt;/CODE&gt;&lt;BR /&gt;
This will result in a single count = 1, given that the previous part of the query was a single row result.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| eventstats sum(count) As total&lt;/CODE&gt;&lt;BR /&gt;
This will therefore also result in 1.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;| eval percent=round((100*count/total),2)&lt;/CODE&gt;&lt;BR /&gt;
This would make sense if the count and total made sense.&lt;/P&gt;

&lt;P&gt;Can you please explain what percentage you want to calculate (and timechart)?&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 12:23:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-usind-the-percentage-field/m-p/411141#M118607</guid>
      <dc:creator>FrankVl</dc:creator>
      <dc:date>2018-06-27T12:23:45Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart usind the percentage field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-usind-the-percentage-field/m-p/411142#M118608</link>
      <description>&lt;P&gt;Hi @duygu,&lt;/P&gt;

&lt;P&gt;Are you looking for something like this?&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="your index" source="your source"|timechart span=10m count(bytes)  by clientip 
|addtotals row=true fieldname=_Total|foreach * [eval &amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt; = round(('&amp;lt;&amp;lt;FIELD&amp;gt;&amp;gt;' * 100 / _Total),2)]
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;change the &lt;CODE&gt;span&lt;/CODE&gt; and also the aggregation function &lt;CODE&gt;count&lt;/CODE&gt; according to your requirement&lt;/P&gt;</description>
      <pubDate>Wed, 27 Jun 2018 12:49:30 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-usind-the-percentage-field/m-p/411142#M118608</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-06-27T12:49:30Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart usind the percentage field</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-usind-the-percentage-field/m-p/411143#M118609</link>
      <description>&lt;P&gt;Hi @duygu, lets know if you still have questions&lt;/P&gt;</description>
      <pubDate>Wed, 04 Jul 2018 13:21:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-usind-the-percentage-field/m-p/411143#M118609</guid>
      <dc:creator>renjith_nair</dc:creator>
      <dc:date>2018-07-04T13:21:46Z</dc:date>
    </item>
  </channel>
</rss>

