<?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 average page size from access logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56338#M179848</link>
    <description>&lt;P&gt;Thanks Ayn. if i have both stats and top,  results are not looking right. If i took out top, i don't see percentage for the commands. Any suggestions?&lt;/P&gt;

&lt;P&gt;| stats count, avg(PageSize) as AvgPageSize by command | top limit=5000 command&lt;/P&gt;</description>
    <pubDate>Thu, 06 Dec 2012 15:47:20 GMT</pubDate>
    <dc:creator>xvxt006</dc:creator>
    <dc:date>2012-12-06T15:47:20Z</dc:date>
    <item>
      <title>How to get average page size from access logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56336#M179846</link>
      <description>&lt;P&gt;Hi, From the access logs, i am getting the commands (part of URI) and their execution count in a tabular format. I want to add average page size to it. I am able to extract the page size individually by adding a field. But how can i include it in the same query so that i can get all stats with same query.&lt;/P&gt;

&lt;P&gt;Current query&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=accesscombinedwcookie host=prgwc* | rex field=uri "((?:/wrewwee/)|(?:/werwerww/eww/))(?[a-zA-Z0-9]+)" | top limit=5000 command&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;For example, right now i have the output looks like this.&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Command    Count          Percentage          &lt;BR /&gt;
Search     14000             8% &lt;BR /&gt;
Home       7000              4%&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;I would like to have the output like this&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;Command    Count          Percentage   AvgPageSize       &lt;BR /&gt;
Search     14000             8%            60k&lt;BR /&gt;
Home       7000              4%            50k&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;How can i do this? Any help is appreciated &lt;span class="lia-unicode-emoji" title=":slightly_smiling_face:"&gt;🙂&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2012 15:01:21 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56336#M179846</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2012-12-06T15:01:21Z</dc:date>
    </item>
    <item>
      <title>Re: How to get average page size from access logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56337#M179847</link>
      <description>&lt;P&gt;If you use the &lt;CODE&gt;stats&lt;/CODE&gt; command, you can just add this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | stats count,avg(PageSize) as AvgPageSize by command
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;(assuming you have the page size extracted to a field called "PageSize")&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2012 15:05:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56337#M179847</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-12-06T15:05:41Z</dc:date>
    </item>
    <item>
      <title>Re: How to get average page size from access logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56338#M179848</link>
      <description>&lt;P&gt;Thanks Ayn. if i have both stats and top,  results are not looking right. If i took out top, i don't see percentage for the commands. Any suggestions?&lt;/P&gt;

&lt;P&gt;| stats count, avg(PageSize) as AvgPageSize by command | top limit=5000 command&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2012 15:47:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56338#M179848</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2012-12-06T15:47:20Z</dc:date>
    </item>
    <item>
      <title>Re: How to get average page size from access logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56339#M179849</link>
      <description>&lt;P&gt;I think you will be wanting appendcols command. The problem is that you have to different operations you want (top and stats). It makes the search longer, and runs 2 searches, but with different styles of data stats. Try this:&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;sourcetype=accesscombinedwcookie host=prgwc* | rex field=uri "((?:/wrewwee/)|(?:/werwerww/eww/))(?[a-zA-Z0-9]+)" | top limit=5000 command | appendcols [search sourcetype=accesscombinedwcookie host=prgwc* | rex field=uri "((?:/wrewwee/)|(?:/werwerww/eww/))(?[a-zA-Z0-9]+)" | stats avg(PageSize) as AvgPageSize by command]&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Appendcols" target="test_blank"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Appendcols&lt;/A&gt;&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2012 16:04:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56339#M179849</guid>
      <dc:creator>alacercogitatus</dc:creator>
      <dc:date>2012-12-06T16:04:07Z</dc:date>
    </item>
    <item>
      <title>Re: How to get average page size from access logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56340#M179850</link>
      <description>&lt;P&gt;Yeah you can't use both. The caveat with not using the &lt;CODE&gt;top&lt;/CODE&gt; command is that you won't get the percent field. There are ways of calculating it with &lt;CODE&gt;stats&lt;/CODE&gt; as well, though it's a bit more work than with &lt;CODE&gt;top&lt;/CODE&gt;. Do you want the percent field?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2012 16:34:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56340#M179850</guid>
      <dc:creator>Ayn</dc:creator>
      <dc:date>2012-12-06T16:34:12Z</dc:date>
    </item>
    <item>
      <title>Re: How to get average page size from access logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56341#M179851</link>
      <description>&lt;P&gt;Awesome. I am getting the results on the first look they are looking good. Thanks for your help.&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2012 16:42:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56341#M179851</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2012-12-06T16:42:37Z</dc:date>
    </item>
    <item>
      <title>Re: How to get average page size from access logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56342#M179852</link>
      <description>&lt;P&gt;Hi, when i try to drill down, i am getting this message "PARSER: Applying intentions failed Unable to drilldown because of post-reporting 'appendcols' command". any idea why we would get this?&lt;/P&gt;</description>
      <pubDate>Thu, 06 Dec 2012 17:00:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-get-average-page-size-from-access-logs/m-p/56342#M179852</guid>
      <dc:creator>xvxt006</dc:creator>
      <dc:date>2012-12-06T17:00:58Z</dc:date>
    </item>
  </channel>
</rss>

