<?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: stat aggregate? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39975#M178866</link>
    <description>&lt;P&gt;No, the &lt;CODE&gt;field&lt;/CODE&gt; argument for &lt;CODE&gt;rex&lt;/CODE&gt; refers to what field it should read FROM (default is &lt;CODE&gt;_raw&lt;/CODE&gt;), not what field it should write. You need to read up on the syntax.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;As for the stats command, I'm not sure what you want to achieve when splitting by &lt;CODE&gt;_time&lt;/CODE&gt;. If you want to create a timechart, have a look at the &lt;CODE&gt;timechart&lt;/CODE&gt; command instead.&lt;/P&gt;</description>
    <pubDate>Tue, 01 May 2012 19:11:45 GMT</pubDate>
    <dc:creator>Ayn</dc:creator>
    <dc:date>2012-05-01T19:11:45Z</dc:date>
    <item>
      <title>stat aggregate?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39970#M178861</link>
      <description>&lt;P&gt;log1:1min:1;5min:1;60min:1;24min:1&lt;/P&gt;

&lt;P&gt;log2:1min:1;5min:1;60min:1;24min:1&lt;/P&gt;

&lt;P&gt;Total: 1min:2;5min:2;60min:2;24min:2&lt;/P&gt;

&lt;P&gt;How to compute the Total line from the above two log lines? Confused which Aggregate function I need use as the sum-aggregation span across log statements, not with-in single log statement. Any Help is appreciated.&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2012 05:20:33 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39970#M178861</guid>
      <dc:creator>rguntupalli8</dc:creator>
      <dc:date>2012-05-01T05:20:33Z</dc:date>
    </item>
    <item>
      <title>Re: stat aggregate?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39971#M178862</link>
      <description>&lt;P&gt;Do you have these values extracted into fields?&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2012 05:47:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39971#M178862</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-05-01T05:47:36Z</dc:date>
    </item>
    <item>
      <title>Re: stat aggregate?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39972#M178863</link>
      <description>&lt;P&gt;Hi Ayn, Thanks for the response.&lt;BR /&gt;
Not yet extracted into fields.&lt;BR /&gt;
Currently I am writing a program which log these statements. &lt;BR /&gt;
 * I am trying to find out the best log format for Splunk to do this aggregation.&lt;BR /&gt;
 * Once written the best stat-aggregate function to get the Total line.&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2012 14:12:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39972#M178863</guid>
      <dc:creator>rguntupalli8</dc:creator>
      <dc:date>2012-05-01T14:12:35Z</dc:date>
    </item>
    <item>
      <title>Re: stat aggregate?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39973#M178864</link>
      <description>&lt;P&gt;If you get the values extracted in fields this should be very easy to accomplish using the &lt;CODE&gt;stats&lt;/CODE&gt; command. For instance, to get the total of fields called &lt;CODE&gt;1min&lt;/CODE&gt;, &lt;CODE&gt;5min&lt;/CODE&gt;, &lt;CODE&gt;60min&lt;/CODE&gt; and &lt;CODE&gt;24min&lt;/CODE&gt;:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats sum(1min),sum(5min),sum(60min),sum(24min)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;...or just&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats sum(*min)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Tue, 01 May 2012 14:56:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39973#M178864</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-05-01T14:56:25Z</dc:date>
    </item>
    <item>
      <title>Re: stat aggregate?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39974#M178865</link>
      <description>&lt;P&gt;Hi Ayn,&lt;/P&gt;

&lt;P&gt;Does something like below work? - Without Field extractions?&lt;BR /&gt;
Can we use extract(1min) or rex as below?&lt;BR /&gt;
ProcessService | rex field=1min (?&lt;ONEVAL&gt;\w+);field=5min (?&lt;FIVEVAL&gt;\w+);field=60min (?&lt;SIXTYVAL&gt;\w+);field=24hr (?&lt;TFVAL&gt;\w+); | stats&lt;BR /&gt;
sum(oneval),sum(fiveval),sum(sixtyval),sum(tfval) by _time&lt;/TFVAL&gt;&lt;/SIXTYVAL&gt;&lt;/FIVEVAL&gt;&lt;/ONEVAL&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2012 19:01:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39974#M178865</guid>
      <dc:creator>rguntupalli8</dc:creator>
      <dc:date>2012-05-01T19:01:22Z</dc:date>
    </item>
    <item>
      <title>Re: stat aggregate?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39975#M178866</link>
      <description>&lt;P&gt;No, the &lt;CODE&gt;field&lt;/CODE&gt; argument for &lt;CODE&gt;rex&lt;/CODE&gt; refers to what field it should read FROM (default is &lt;CODE&gt;_raw&lt;/CODE&gt;), not what field it should write. You need to read up on the syntax.&lt;/P&gt;

&lt;P&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval"&gt;http://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eval&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;As for the stats command, I'm not sure what you want to achieve when splitting by &lt;CODE&gt;_time&lt;/CODE&gt;. If you want to create a timechart, have a look at the &lt;CODE&gt;timechart&lt;/CODE&gt; command instead.&lt;/P&gt;</description>
      <pubDate>Tue, 01 May 2012 19:11:45 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39975#M178866</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-05-01T19:11:45Z</dc:date>
    </item>
    <item>
      <title>Re: stat aggregate?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39976#M178867</link>
      <description>&lt;P&gt;Hi Ayn,&lt;/P&gt;

&lt;P&gt;Trying to add field extract to solve the above problem.&lt;BR /&gt;
1min=1;5min=1;60min=1;24hr=1&lt;BR /&gt;
In Add new field extraction screen entered below regex. Is this OK?&lt;BR /&gt;
1min (?&amp;lt;1min_val&amp;gt;\d+);&lt;BR /&gt;
After adding the above I have used the below which didn't give me any results.&lt;BR /&gt;
index=main sourcetype="splunk-too_small" | stats sum(1min_val)&lt;BR /&gt;
Please help on this.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 11:45:49 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39976#M178867</guid>
      <dc:creator>rguntupalli8</dc:creator>
      <dc:date>2020-09-28T11:45:49Z</dc:date>
    </item>
    <item>
      <title>Re: stat aggregate?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39977#M178868</link>
      <description>&lt;P&gt;No, your regex is likely not matching. You should try out your regex in the interactive field extractor in Splunk, or on some external regex checker tool such as regexpal.com.&lt;/P&gt;</description>
      <pubDate>Wed, 02 May 2012 05:03:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/stat-aggregate/m-p/39977#M178868</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-05-02T05:03:37Z</dc:date>
    </item>
  </channel>
</rss>

