<?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 edit my search to calculate percentage for each row? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291194#M87981</link>
    <description>&lt;P&gt;Yes this is the solution&lt;/P&gt;</description>
    <pubDate>Sat, 13 May 2017 09:37:53 GMT</pubDate>
    <dc:creator>sonila</dc:creator>
    <dc:date>2017-05-13T09:37:53Z</dc:date>
    <item>
      <title>How to edit my search to calculate percentage for each row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291186#M87973</link>
      <description>&lt;PRE&gt;&lt;CODE&gt;earliest=-72h@h latest=@h index=dga | transaction  EventType maxevents=2 |stats count as total | appendcols [search earliest=-72h@h latest=@h index=dga | transaction  EventType maxevents=2| where Result="False" OR Result="false" |timechart span=1h  count  | eval time=_time-now()%259200 | timechart span=24h sum(count) as count |  tail 3 | tail 2 | eval _time=_time+now()%259200] | eval percentage=count*100/total | table count, p
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Why can't it calculate the whole percentage? It calculates only for the first row&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 19:08:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291186#M87973</guid>
      <dc:creator>sonila</dc:creator>
      <dc:date>2017-05-12T19:08:36Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate percentage for each row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291187#M87974</link>
      <description>&lt;P&gt;The first query of your's is giving only single row (output of stats) hence the field total is only populated in row1 and thus percentage is only available in row1. I believe something like this would work efficiently and give you expected result.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-72h@h latest=@h index=dga | transaction EventType maxevents=2 | eventstats count as total
| where Result="False" OR Result="false" |timechart span=1h count max(total) as total | eval time=_time-now()%259200 | timechart span=24h sum(count) as count max(total) as total | tail 2 | eval _time=_time+now()%259200 | eval percentage=count*100/total | table count, p
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 12 May 2017 19:28:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291187#M87974</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-12T19:28:09Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate percentage for each row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291188#M87975</link>
      <description>&lt;P&gt;nope doesnt work this&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;earliest=-72h@h latest=@h index=dga | transaction  EventType maxevents=2| where Result="False" OR Result="false" |timechart span=1h  count | eval time=_time-now()%259200 | timechart span=24h sum(count) as count |  tail 3 | tail 2 | eval _time=_time+now()%259200 | appendcols [ search earliest=-72h@h latest=@h index=dga | transaction  EventType maxevents=2 | timechart span=1h  count as total |eval time=_time-now()%259200 | timechart span=24h sum(total) as total |  tail 3 | tail 2 | eval _time=_time+now()%259200  ] | eval p=count*100/total | eval p = if(isnull(p), 0, p) |fields + p
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this gave me the solution wanted&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 20:17:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291188#M87975</guid>
      <dc:creator>sonila</dc:creator>
      <dc:date>2017-05-12T20:17:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate percentage for each row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291189#M87976</link>
      <description>&lt;P&gt;Could you describe what's the problem you see with the results?&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 21:21:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291189#M87976</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2017-05-12T21:21:04Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate percentage for each row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291190#M87977</link>
      <description>&lt;P&gt;Your solution didnt calculate percentage of each row. &lt;BR /&gt;
Instead my version gave me the results for each row.&lt;BR /&gt;
&lt;CODE&gt;earliest=-72h@h latest=@h index=dga | transaction EventType maxevents=2| where Result="False" OR Result="false" |timechart span=1h count | eval time=_time-now()%259200 | timechart span=24h sum(count) as count | tail 3 | tail 2 | eval _time=_time+now()%259200&lt;/CODE&gt; --&amp;gt; this gave me the number of events of errors counted by time&lt;BR /&gt;
and &lt;BR /&gt;
&lt;CODE&gt;appendcols [ search earliest=-72h@h latest=@h index=dga | transaction EventType maxevents=2 | timechart span=1h count as total |eval time=_time-now()%259200 | timechart span=24h sum(total) as total | tail 3 | tail 2 | eval _time=_time+now()%259200 ] | eval p=count*100/total&lt;/CODE&gt; ---&amp;gt; this gave me the total and percentage of each row&lt;/P&gt;</description>
      <pubDate>Fri, 12 May 2017 21:27:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291190#M87977</guid>
      <dc:creator>sonila</dc:creator>
      <dc:date>2017-05-12T21:27:17Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate percentage for each row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291191#M87978</link>
      <description>&lt;P&gt;Your &lt;CODE&gt;transaction&lt;/CODE&gt; commands look strange to me and I suspect that are gross overkill for what you are trying to do.  Please show a few sample events and the desire end result.  I am sure that we can create something in a much more efficient way than the path that you are on.&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 00:34:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291191#M87978</guid>
      <dc:creator>woodcock</dc:creator>
      <dc:date>2017-05-13T00:34:39Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate percentage for each row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291192#M87979</link>
      <description>&lt;P&gt;@sonila - I just want to confirm: The solution you found above is the answer to your question? If yes, let me know and I can convert your comment as the answer to "Accept". If no and you want to leave your question open for other suggestions, no action needs to be taken.&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 01:50:01 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291192#M87979</guid>
      <dc:creator>aaraneta_splunk</dc:creator>
      <dc:date>2017-05-13T01:50:01Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate percentage for each row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291193#M87980</link>
      <description>&lt;P&gt;I need to count two events as one. thats why i used transaction command&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 09:37:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291193#M87980</guid>
      <dc:creator>sonila</dc:creator>
      <dc:date>2017-05-13T09:37:05Z</dc:date>
    </item>
    <item>
      <title>Re: How to edit my search to calculate percentage for each row?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291194#M87981</link>
      <description>&lt;P&gt;Yes this is the solution&lt;/P&gt;</description>
      <pubDate>Sat, 13 May 2017 09:37:53 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-edit-my-search-to-calculate-percentage-for-each-row/m-p/291194#M87981</guid>
      <dc:creator>sonila</dc:creator>
      <dc:date>2017-05-13T09:37:53Z</dc:date>
    </item>
  </channel>
</rss>

