<?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 Group aggregate on logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Group-aggregate-on-logs/m-p/38251#M8686</link>
    <description>&lt;P&gt;for example, i have the following 7 logs,&lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Maps-US-Sunnyvale" delta_msec="1487" seq="3" &lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Maps-US-MountainView" delta_msec="1445" seq="2" &lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Maps-US-SF" delta_msec="1465" seq="2"&lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Store-CA-MountainView" delta_msec="1445" seq="2"&lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Store-CA-SF" delta_msec="1245" seq="2"&lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Msg-CA-MountainView" delta_msec="1445" seq="2"&lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Msg-CA-SF" delta_msec="1245" seq="2"&lt;/P&gt;

&lt;P&gt;i want to calculate a new field(avg_msec) based on the "slotid" &lt;BR /&gt;
we would like to calculate an average for all logs matching "Location-Maps"&lt;BR /&gt;
we would like to calculate an average for all logs matching "Location-Store"&lt;BR /&gt;
we would like to calculate an average for all logs matching "Location-Msg"&lt;/P&gt;

&lt;P&gt;Can somebody help write the search string? Thanks!&lt;/P&gt;</description>
    <pubDate>Tue, 20 Dec 2011 22:05:31 GMT</pubDate>
    <dc:creator>xiaoyuew</dc:creator>
    <dc:date>2011-12-20T22:05:31Z</dc:date>
    <item>
      <title>Group aggregate on logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-aggregate-on-logs/m-p/38251#M8686</link>
      <description>&lt;P&gt;for example, i have the following 7 logs,&lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Maps-US-Sunnyvale" delta_msec="1487" seq="3" &lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Maps-US-MountainView" delta_msec="1445" seq="2" &lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Maps-US-SF" delta_msec="1465" seq="2"&lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Store-CA-MountainView" delta_msec="1445" seq="2"&lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Store-CA-SF" delta_msec="1245" seq="2"&lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Msg-CA-MountainView" delta_msec="1445" seq="2"&lt;/P&gt;

&lt;P&gt;2011-DEC-17 slotid="Location-Msg-CA-SF" delta_msec="1245" seq="2"&lt;/P&gt;

&lt;P&gt;i want to calculate a new field(avg_msec) based on the "slotid" &lt;BR /&gt;
we would like to calculate an average for all logs matching "Location-Maps"&lt;BR /&gt;
we would like to calculate an average for all logs matching "Location-Store"&lt;BR /&gt;
we would like to calculate an average for all logs matching "Location-Msg"&lt;/P&gt;

&lt;P&gt;Can somebody help write the search string? Thanks!&lt;/P&gt;</description>
      <pubDate>Tue, 20 Dec 2011 22:05:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-aggregate-on-logs/m-p/38251#M8686</guid>
      <dc:creator>xiaoyuew</dc:creator>
      <dc:date>2011-12-20T22:05:31Z</dc:date>
    </item>
    <item>
      <title>Re: Group aggregate on logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Group-aggregate-on-logs/m-p/38252#M8687</link>
      <description>&lt;P&gt;Hi there,&lt;/P&gt;

&lt;P&gt;Something along the lines of;&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|rex field=slotid "Location-(?&amp;lt;ZZZZ&amp;gt;[^-]+)-" | stats avg(delta_msec) AS avg_msec by ZZZZ
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;this should extract "Maps", "Store" and "Msg" into a new field called ZZZZ, which you subsequently can run ordinary &lt;CODE&gt;stats&lt;/CODE&gt; commands on.&lt;/P&gt;

&lt;P&gt;Hope this helps,&lt;/P&gt;

&lt;P&gt;Kristian&lt;/P&gt;</description>
      <pubDate>Wed, 21 Dec 2011 11:07:39 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Group-aggregate-on-logs/m-p/38252#M8687</guid>
      <dc:creator>kristian_kolb</dc:creator>
      <dc:date>2011-12-21T11:07:39Z</dc:date>
    </item>
  </channel>
</rss>

