<?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 get sum of GC time spend in last 4 hours? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/631922#M219491</link>
    <description>&lt;P&gt;It's a pretty straightforward query for that&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search_to_get_data
``` Extract the ms time field from your event with a suitable rex statement ```
| rex "\[(?&amp;lt;ms&amp;gt;[\d\.]*)\]"
| timechart span=1h sum(ms) as total
``` Calculate the percentage of total ms per hour ```
| eval percent=round(total / 3600000 * 100, 2)
&lt;/LI-CODE&gt;&lt;P&gt;If that is not giving you what you expect, post your search and results.&lt;/P&gt;&lt;P&gt;The rex regular expression will work on your _raw event - if you already have field extractions, it may need modification.&lt;/P&gt;</description>
    <pubDate>Wed, 22 Feb 2023 21:57:51 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-02-22T21:57:51Z</dc:date>
    <item>
      <title>How to get sum of GC time spend in last 4 hours?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/631767#M219439</link>
      <description>&lt;P&gt;Hi Splunkers,&lt;/P&gt;
&lt;P&gt;I have a GC log like below:&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;[716920.165s][info][gc] GC(27612) Concurrent reset 24.051ms
[716909.883s][info][gc] GC(27611) Concurrent update references 3124.593ms
[716909.885s][info][gc] GC(27611) Pause Final Update Refs 1.336ms
[716909.885s][info][gc] GC(27611) Concurrent cleanup 79178M-&amp;gt;58868M(153600M) 0.143ms
[716906.314s][info][gc] GC(27611) Pause Final Mark 2121.376ms
[716906.315s][info][gc] GC(27611) Concurrent cleanup 71900M-&amp;gt;71709M(153600M) 0.240ms
[716906.757s][info][gc] GC(27611) Concurrent evacuation 441.920ms
[716906.758s][info][gc] GC(27611) Pause Init Update Refs 0.126ms&lt;/LI-CODE&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I'm trying to get statistic related to total time spend by all these fields (the values in ms at the end of line).&amp;nbsp; I mean calculated all events in ms and drew a chart or table with total value from last 4 hours.&lt;/P&gt;
&lt;P&gt;For instance&amp;nbsp;&lt;/P&gt;
&lt;P&gt;19.00 - 245000ms&lt;/P&gt;
&lt;P&gt;20.00 - 344000ms&amp;nbsp;&lt;/P&gt;
&lt;P&gt;21.00 - 345500ms&lt;/P&gt;
&lt;P&gt;22.00 - 452000ms&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I did manage to extract time needed in ms from all fields, but when I use query like:&lt;/P&gt;
&lt;P&gt;&lt;EM&gt;timechart span=1h sum(eval(Concurrent_reset+Concurrent_Update+ Pause_Final_Mark+Concurrent_cleanup+Concurrant_evacuation+Pause_Init_Update)) as total&lt;/EM&gt;&lt;/P&gt;
&lt;P&gt;i just receive results from 19.00-20.00 timespan. What I doing wrong here?&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;regards,&lt;/P&gt;
&lt;P&gt;Sz&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 21 Feb 2023 23:59:52 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/631767#M219439</guid>
      <dc:creator>slipinski</dc:creator>
      <dc:date>2023-02-21T23:59:52Z</dc:date>
    </item>
    <item>
      <title>Re: How to get sum of GC time spend in last 4 hours?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/631779#M219444</link>
      <description>&lt;P&gt;What is your _time value in the event? Splunk calculates it's buckets based on the event time and there is no obvious time value in that data.&lt;/P&gt;&lt;P&gt;The initial number could be time, but there's no reference point and if it represents seconds, that data is only covering 14 seconds&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;716906.314 - 716920.165&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 02:06:46 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/631779#M219444</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-22T02:06:46Z</dc:date>
    </item>
    <item>
      <title>Re: How to get sum of GC time spend in last 4 hours?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/631823#M219465</link>
      <description>&lt;P&gt;Hi,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;I don't take into account the timestamp at the beginning of every line. Relying on Splunk-added timestamp is okay.&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;716906.314 - 716920.165&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;I'm struggling with an accumulation of time&amp;nbsp; in ms at the end of every log line like:&lt;/P&gt;&lt;PRE&gt;24.051&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;3124.593&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;and divide it into hours (Splunk timestampt)&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 09:49:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/631823#M219465</guid>
      <dc:creator>slipinski</dc:creator>
      <dc:date>2023-02-22T09:49:49Z</dc:date>
    </item>
    <item>
      <title>Re: How to get sum of GC time spend in last 4 hours?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/631825#M219466</link>
      <description>&lt;P&gt;How are you struggling? Your example shows that you expect the following information&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;19.00 - 245000ms
20.00 - 344000ms 
21.00 - 345500ms
22.00 - 452000ms &lt;/LI-CODE&gt;&lt;P&gt;but from your visible data there is no way it can add up to those values in those time ranges.&lt;/P&gt;&lt;P&gt;timechart will calculate the sum in the 1 hour time range based on its value of _time and the sum of the extracted fields in your sum(eval(...)) statement&lt;/P&gt;&lt;P&gt;So please explain and provide an example of your data and an example of the output you are seeing - long with the search you are running.&amp;nbsp;Without that, it's very difficult to suggest what the problem is.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 10:08:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/631825#M219466</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-22T10:08:54Z</dc:date>
    </item>
    <item>
      <title>Re: How to get sum of GC time spend in last 4 hours?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/631829#M219468</link>
      <description>&lt;P&gt;Dear&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Apologies for not being entirely clear in previous messages. No wonder you got confused.&lt;/P&gt;&lt;P&gt;Let me clarify this again.&lt;/P&gt;&lt;P&gt;I got logs:&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;Splunk_timestamp EventA time_used [249.34ms]
Splunk_timestamp EventB time_used [246.23ms]
Splunk_timestamp EventC time_used [323.11ms]
Splunk_timestamp EventA time_used [1445.12ms]&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;I managed to extract time_used value per event.&amp;nbsp;&lt;/P&gt;&lt;P&gt;I would like to have a total sum of time_used from all events per hour.&amp;nbsp;&lt;/P&gt;&lt;P&gt;The next step would be having percentage of time_used total number/number of ms in day i.e. (3 600 000 ms - 1000ms*60*60).&amp;nbsp;&lt;/P&gt;&lt;P&gt;My query was a crap, so I'm not attaching it here.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 11:13:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/631829#M219468</guid>
      <dc:creator>slipinski</dc:creator>
      <dc:date>2023-02-22T11:13:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to get sum of GC time spend in last 4 hours?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/631922#M219491</link>
      <description>&lt;P&gt;It's a pretty straightforward query for that&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;your_search_to_get_data
``` Extract the ms time field from your event with a suitable rex statement ```
| rex "\[(?&amp;lt;ms&amp;gt;[\d\.]*)\]"
| timechart span=1h sum(ms) as total
``` Calculate the percentage of total ms per hour ```
| eval percent=round(total / 3600000 * 100, 2)
&lt;/LI-CODE&gt;&lt;P&gt;If that is not giving you what you expect, post your search and results.&lt;/P&gt;&lt;P&gt;The rex regular expression will work on your _raw event - if you already have field extractions, it may need modification.&lt;/P&gt;</description>
      <pubDate>Wed, 22 Feb 2023 21:57:51 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/631922#M219491</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-02-22T21:57:51Z</dc:date>
    </item>
    <item>
      <title>Re: How to get sum of GC time spend in last 4 hours?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/632151#M219582</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/6367"&gt;@bowesmana&lt;/a&gt;&amp;nbsp;You nail it!&lt;/P&gt;&lt;P&gt;I had to play with regex a little bit, but I managed to achieve what I wanted.&amp;nbsp;&lt;/P&gt;&lt;P&gt;Thanks a lot.&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Fri, 24 Feb 2023 07:53:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-sum-of-GC-time-spend-in-last-4-hours/m-p/632151#M219582</guid>
      <dc:creator>slipinski</dc:creator>
      <dc:date>2023-02-24T07:53:28Z</dc:date>
    </item>
  </channel>
</rss>

