<?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: Gathering Stats on Log Entries within a Time Period Denoted by Log Entries in another Log in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Gathering-Stats-on-Log-Entries-within-a-Time-Period-Denoted-by/m-p/150724#M42231</link>
    <description>&lt;P&gt;This would be easier if you actually posted your searches. Thanks!&lt;/P&gt;</description>
    <pubDate>Fri, 02 May 2014 16:44:56 GMT</pubDate>
    <dc:creator>lguinn2</dc:creator>
    <dc:date>2014-05-02T16:44:56Z</dc:date>
    <item>
      <title>Gathering Stats on Log Entries within a Time Period Denoted by Log Entries in another Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Gathering-Stats-on-Log-Entries-within-a-Time-Period-Denoted-by/m-p/150723#M42230</link>
      <description>&lt;P&gt;Hi Guys,&lt;/P&gt;

&lt;P&gt;I have log entries in one log file that denote the start and end of a time frame of interest in my logs. These log entries look like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2014/05/01 11:50:47.255 StartedJob Job=Job-105
2014/05/01 11:52:26.545 EndedJob Job=Job-105'
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Pretty easy to make a transaction out of this and figure out when my job started and when my job ended and how long my job took. Now, in another log source I'm recording my system load (every second) as the number of events/second that my system is generating. The entries in that log look like this &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;2014/05/01 11:50:46.000 Events=27
2014/05/01 11:50:47.000 Events=234
2014/05/01 11:50:48.000 Events=269
2014/05/01 11:50:49.000 Events=307
2014/05/01 11:50:50.000 Events=145
2014/05/01 11:50:51.000 Events=14
...
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I would love to show system load statistics (let's say count of system events) while a Job is running. Oh and another little wrinkle, Jobs will overlap sometimes (which is fine, I will likely observe spikes in system load). I'd like to analyze the effect of particular Jobs on system load. &lt;/P&gt;

&lt;P&gt;Now maybe it would be more useful to annotate a "System Load" line chart with Job (Started and Ended) events? I guess I could post that as another question&lt;/P&gt;

&lt;P&gt;It would be awesome if someone could point me in a direction here.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 16:39:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Gathering-Stats-on-Log-Entries-within-a-Time-Period-Denoted-by/m-p/150723#M42230</guid>
      <dc:creator>derekwalsh_1</dc:creator>
      <dc:date>2014-05-02T16:39:28Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering Stats on Log Entries within a Time Period Denoted by Log Entries in another Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Gathering-Stats-on-Log-Entries-within-a-Time-Period-Denoted-by/m-p/150724#M42231</link>
      <description>&lt;P&gt;This would be easier if you actually posted your searches. Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 16:44:56 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Gathering-Stats-on-Log-Entries-within-a-Time-Period-Denoted-by/m-p/150724#M42231</guid>
      <dc:creator>lguinn2</dc:creator>
      <dc:date>2014-05-02T16:44:56Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering Stats on Log Entries within a Time Period Denoted by Log Entries in another Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Gathering-Stats-on-Log-Entries-within-a-Time-Period-Denoted-by/m-p/150725#M42232</link>
      <description>&lt;P&gt;Sorry, I would if I actually had any &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 16:53:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Gathering-Stats-on-Log-Entries-within-a-Time-Period-Denoted-by/m-p/150725#M42232</guid>
      <dc:creator>derekwalsh_1</dc:creator>
      <dc:date>2014-05-02T16:53:15Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering Stats on Log Entries within a Time Period Denoted by Log Entries in another Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Gathering-Stats-on-Log-Entries-within-a-Time-Period-Denoted-by/m-p/150726#M42233</link>
      <description>&lt;P&gt;You can do something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;base search for job starts and ends | transaction over your job id | eval end_time = _time + duration | map maxsearches=0 search="sourcetype=system_load earliest=$_time$ latest=$end_time$ | eval job=$job$ | stats sum(Events) by job"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;That should run one search for each job, limited to the runtime of the job and summing up the event counter per job. You may need to adjust the syntax, field names, etc. to fit your environment.&lt;/P&gt;</description>
      <pubDate>Fri, 02 May 2014 17:12:09 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Gathering-Stats-on-Log-Entries-within-a-Time-Period-Denoted-by/m-p/150726#M42233</guid>
      <dc:creator>martin_mueller</dc:creator>
      <dc:date>2014-05-02T17:12:09Z</dc:date>
    </item>
    <item>
      <title>Re: Gathering Stats on Log Entries within a Time Period Denoted by Log Entries in another Log</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Gathering-Stats-on-Log-Entries-within-a-Time-Period-Denoted-by/m-p/150727#M42234</link>
      <description>&lt;P&gt;Yep. Sweet. Minor correction&lt;/P&gt;

&lt;P&gt;&lt;PRE&gt;&lt;CODE&gt;&lt;BR /&gt;
base search for job starts and ends | transaction over your job id | eval end_time = _time + duration | map maxsearches=0 search="search sourcetype=system_load earliest=$_time$ latest=$end_time$ | eval job=$job$" | stats sum(Events) by job &lt;/CODE&gt;&lt;/PRE&gt;&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 16:31:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Gathering-Stats-on-Log-Entries-within-a-Time-Period-Denoted-by/m-p/150727#M42234</guid>
      <dc:creator>derekwalsh_1</dc:creator>
      <dc:date>2020-09-28T16:31:32Z</dc:date>
    </item>
  </channel>
</rss>

