<?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: eval and timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/eval-and-timechart/m-p/556449#M158035</link>
    <description>&lt;P&gt;There's no need to use stats/bin, you can do it all with timechart and post calculations.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="acoe_np_spa_metrics"
| search Project="*" AND Volume="*" 
| timechart span=1mon count(eval(D_Status="F")) as success_count
  count(eval(D_Status="S")) as failure_count count as Total
| eval STP=(success_count/Total)*100 
| fields - Total &lt;/LI-CODE&gt;&lt;P&gt;So generate the timechart and include the Total count per month also, then just calculate the success percentage at the end and then remove the Total field if you don't want it.&lt;/P&gt;&lt;P&gt;Note that this assumes Total will be the same as success+failure - if not, then calculate Total afterwards instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Mon, 21 Jun 2021 04:14:25 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2021-06-21T04:14:25Z</dc:date>
    <item>
      <title>eval and timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-and-timechart/m-p/556420#M158022</link>
      <description>&lt;P&gt;How can I get STP as a bar chart ? im getting error when i try to do it like this&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sphiwee_0-1624211848747.png" style="width: 400px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/14697i0FEC96F5E1322BCF/image-size/medium?v=v2&amp;amp;px=400" role="button" title="sphiwee_0-1624211848747.png" alt="sphiwee_0-1624211848747.png" /&gt;&lt;/span&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;i want to display STP for each month&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jun 2021 18:00:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-and-timechart/m-p/556420#M158022</guid>
      <dc:creator>sphiwee</dc:creator>
      <dc:date>2021-06-20T18:00:11Z</dc:date>
    </item>
    <item>
      <title>Re: eval and timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-and-timechart/m-p/556421#M158023</link>
      <description>&lt;P&gt;here's the spl query&lt;BR /&gt;&lt;BR /&gt;index="acoe_np_spa_metrics"| search Project="*" AND Volume="*" |bin _time span=1month | stats&lt;BR /&gt;count(eval(D_Status="F")) as success_count&lt;BR /&gt;count(eval(D_Status="S")) as failure_count | eval TOTAL_COUNT=(success_count + failure_count) | eval STP=(success_count/TOTAL_COUNT)*100 | timechart STP&lt;/P&gt;</description>
      <pubDate>Sun, 20 Jun 2021 18:02:19 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-and-timechart/m-p/556421#M158023</guid>
      <dc:creator>sphiwee</dc:creator>
      <dc:date>2021-06-20T18:02:19Z</dc:date>
    </item>
    <item>
      <title>Re: eval and timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-and-timechart/m-p/556449#M158035</link>
      <description>&lt;P&gt;There's no need to use stats/bin, you can do it all with timechart and post calculations.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index="acoe_np_spa_metrics"
| search Project="*" AND Volume="*" 
| timechart span=1mon count(eval(D_Status="F")) as success_count
  count(eval(D_Status="S")) as failure_count count as Total
| eval STP=(success_count/Total)*100 
| fields - Total &lt;/LI-CODE&gt;&lt;P&gt;So generate the timechart and include the Total count per month also, then just calculate the success percentage at the end and then remove the Total field if you don't want it.&lt;/P&gt;&lt;P&gt;Note that this assumes Total will be the same as success+failure - if not, then calculate Total afterwards instead.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 04:14:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-and-timechart/m-p/556449#M158035</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-06-21T04:14:25Z</dc:date>
    </item>
    <item>
      <title>Re: eval and timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-and-timechart/m-p/556505#M158047</link>
      <description>&lt;P&gt;Thanks it works, but seems I actually had to get the sum of the volume where D_status = F and sum of volume where D_Status = S...&amp;nbsp;&lt;BR /&gt;&lt;BR /&gt;How can I achieve this?&lt;/P&gt;</description>
      <pubDate>Mon, 21 Jun 2021 10:18:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-and-timechart/m-p/556505#M158047</guid>
      <dc:creator>sphiwee</dc:creator>
      <dc:date>2021-06-21T10:18:36Z</dc:date>
    </item>
    <item>
      <title>Re: eval and timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/eval-and-timechart/m-p/556597#M158079</link>
      <description>&lt;P&gt;If you want to get the total success/failure counts not split by month then just add an eventstats at the end&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| eventstats sum(success_count) as total_success_count sum(failure_count) as total_failure_count&lt;/LI-CODE&gt;&lt;P&gt;is that what you are after?&lt;/P&gt;</description>
      <pubDate>Tue, 22 Jun 2021 00:55:10 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/eval-and-timechart/m-p/556597#M158079</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2021-06-22T00:55:10Z</dc:date>
    </item>
  </channel>
</rss>

