<?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: [hope someone could help me!] How can reduce records in each row in splunk table. in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/hope-someone-could-help-me-How-can-reduce-records-in-each-row-in/m-p/286119#M86614</link>
    <description>&lt;P&gt;Thanks Sundareshr!&lt;BR /&gt;
very close to my requirement, this will only streamstats 10 events, but I want to stats all event count, only show top 10 for each row.&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jul 2016 03:09:05 GMT</pubDate>
    <dc:creator>jujis008</dc:creator>
    <dc:date>2016-07-29T03:09:05Z</dc:date>
    <item>
      <title>[hope someone could help me!] How can reduce records in each row in splunk table.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/hope-someone-could-help-me-How-can-reduce-records-in-each-row-in/m-p/286117#M86612</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
I was preparing a dashboard but i have some problems while generating the table. I am using sort and stats to group results, but it returns multiple records for each row after grouping, however it is acceptable if records less than 10, but sometimes returns over 20 records. so how can i reduce the records after grouping in table for each row. &lt;BR /&gt;
Here are my queries as follows.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="perf_log_bizx" "EVENT-"| rex field=_raw "\]\s+\[(?&amp;lt;comp_id&amp;gt;[\w]+),(?&amp;lt;comp_name&amp;gt;[\w]+),(?&amp;lt;schema&amp;gt;[\w]+\.),(?&amp;lt;dbpool&amp;gt;[\w]+),(?&amp;lt;user_id&amp;gt;[\w]+),(?&amp;lt;user_name&amp;gt;[\w]+),(?&amp;lt;locale&amp;gt;[\w]+)\]\s+(?&amp;lt;event_name&amp;gt;[\w]+-[\w]+)\s+(?P&amp;lt;event_id&amp;gt;EVENT-.+)\s+(?P&amp;lt;render_time&amp;gt;[\d]+)\s+(?P&amp;lt;server_time&amp;gt;[\d]+)\s+(?P&amp;lt;timems&amp;gt;[\d]+)\s+(?P&amp;lt;js_count&amp;gt;[\d]+)\s+(?P&amp;lt;css_count&amp;gt;[\d]+)\s+.+\]\s+(?P&amp;lt;call_id&amp;gt;[\d]+-[\d]+)\s+(?P&amp;lt;module_id&amp;gt;[\w]+)\s+(?P&amp;lt;page_id&amp;gt;[\w]+)\s+(?&amp;lt;page_qualifier&amp;gt;[\w]+)\s+\[\[(?&amp;lt;memory&amp;gt;\d+)KB\s+(?&amp;lt;TotalCPU&amp;gt;\d+)ms\s+(?&amp;lt;UserCPU&amp;gt;\d+)ms\s+(?&amp;lt;SystemCPU&amp;gt;\d+)ms\s+(?&amp;lt;localread&amp;gt;\d+)KB\s+(?&amp;lt;localwrite&amp;gt;\d+)KB\s+(?&amp;lt;netread&amp;gt;\d+)KB\s+(?&amp;lt;netwrite&amp;gt;\d+)KB\s+(?&amp;lt;openfile&amp;gt;\d+)\s+(?&amp;lt;opensocket&amp;gt;\d+)\s+\]\]" | eval realtime=round(timems/1000, 2) | where realtime&amp;gt;30 | eval samepage= module_id."-".page_id."-".page_qualifier| stats count(samepage) as Frequency, values(module_id) as "Module Id", values(page_id) as "Page Id", values(page_qualifier) as "Page Qualifier", values(event_id) as "Event Id", values(comp_id) as "Company Id", values(user_id) as "User Id", max(realtime) as MaximiumTime(s),  values(realtime) as End2EndTime(s), avg(realtime) as ae2e by samepage | sort 10 -MaximiumTime(s) by samepage | eval AvgE2ETime(s) = round(ae2e, 2)| table "Module Id", "Page Id", "Page Qualifier", "Company Id", "User Id", MaximiumTime(s), Frequency, AvgE2ETime(s), End2EndTime(s)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;and return results as follows:&lt;BR /&gt;
&lt;span class="lia-inline-image-display-wrapper" image-alt="alt text"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/1656i897FCEADB1DE63D7/image-size/large?v=v2&amp;amp;px=999" role="button" title="alt text" alt="alt text" /&gt;&lt;/span&gt;&lt;/P&gt;

&lt;P&gt;Repeat: what am i want is for example the first row in above table only show 5 or 10 records.&lt;BR /&gt;
hope someone could help me! cross finger!&lt;/P&gt;</description>
      <pubDate>Thu, 28 Jul 2016 10:48:07 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/hope-someone-could-help-me-How-can-reduce-records-in-each-row-in/m-p/286117#M86612</guid>
      <dc:creator>jujis008</dc:creator>
      <dc:date>2016-07-28T10:48:07Z</dc:date>
    </item>
    <item>
      <title>Re: [hope someone could help me!] How can reduce records in each row in splunk table.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/hope-someone-could-help-me-How-can-reduce-records-in-each-row-in/m-p/286118#M86613</link>
      <description>&lt;P&gt;Try this. I added a streamstats command to count number of events by samepage and use only event where count&amp;lt;=10. You can change the where to the number of events you would like to include. You can also add a sort before the streamstats to adjust the order (top 10 vs bottom 10 for example)&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="perf_log_bizx" "EVENT-"| rex field=_raw "\]\s+\[(?&amp;lt;comp_id&amp;gt;[\w]+),(?&amp;lt;comp_name&amp;gt;[\w]+),(?&amp;lt;schema&amp;gt;[\w]+\.),(?&amp;lt;dbpool&amp;gt;[\w]+),(?&amp;lt;user_id&amp;gt;[\w]+),(?&amp;lt;user_name&amp;gt;[\w]+),(?&amp;lt;locale&amp;gt;[\w]+)\]\s+(?&amp;lt;event_name&amp;gt;[\w]+-[\w]+)\s+(?P&amp;lt;event_id&amp;gt;EVENT-.+)\s+(?P&amp;lt;render_time&amp;gt;[\d]+)\s+(?P&amp;lt;server_time&amp;gt;[\d]+)\s+(?P&amp;lt;timems&amp;gt;[\d]+)\s+(?P&amp;lt;js_count&amp;gt;[\d]+)\s+(?P&amp;lt;css_count&amp;gt;[\d]+)\s+.+\]\s+(?P&amp;lt;call_id&amp;gt;[\d]+-[\d]+)\s+(?P&amp;lt;module_id&amp;gt;[\w]+)\s+(?P&amp;lt;page_id&amp;gt;[\w]+)\s+(?&amp;lt;page_qualifier&amp;gt;[\w]+)\s+\[\[(?&amp;lt;memory&amp;gt;\d+)KB\s+(?&amp;lt;TotalCPU&amp;gt;\d+)ms\s+(?&amp;lt;UserCPU&amp;gt;\d+)ms\s+(?&amp;lt;SystemCPU&amp;gt;\d+)ms\s+(?&amp;lt;localread&amp;gt;\d+)KB\s+(?&amp;lt;localwrite&amp;gt;\d+)KB\s+(?&amp;lt;netread&amp;gt;\d+)KB\s+(?&amp;lt;netwrite&amp;gt;\d+)KB\s+(?&amp;lt;openfile&amp;gt;\d+)\s+(?&amp;lt;opensocket&amp;gt;\d+)\s+\]\]" | eval realtime=round(timems/1000, 2) | where realtime&amp;gt;30 | eval samepage= module_id."-".page_id."-".page_qualifier |  streamstats count by samepage | where count&amp;lt;=10 | stats count(samepage) as Frequency, values(module_id) as "Module Id", values(page_id) as "Page Id", values(page_qualifier) as "Page Qualifier", values(event_id) as "Event Id", values(comp_id) as "Company Id", values(user_id) as "User Id", max(realtime) as MaximiumTime(s),  values(realtime) as End2EndTime(s), avg(realtime) as ae2e by samepage | sort 10 -MaximiumTime(s) by samepage | eval AvgE2ETime(s) = round(ae2e, 2)| table "Module Id", "Page Id", "Page Qualifier", "Company Id", "User Id", MaximiumTime(s), Frequency, AvgE2ETime(s), End2EndTime(s)
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 28 Jul 2016 21:41:16 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/hope-someone-could-help-me-How-can-reduce-records-in-each-row-in/m-p/286118#M86613</guid>
      <dc:creator>sundareshr</dc:creator>
      <dc:date>2016-07-28T21:41:16Z</dc:date>
    </item>
    <item>
      <title>Re: [hope someone could help me!] How can reduce records in each row in splunk table.</title>
      <link>https://community.splunk.com/t5/Splunk-Search/hope-someone-could-help-me-How-can-reduce-records-in-each-row-in/m-p/286119#M86614</link>
      <description>&lt;P&gt;Thanks Sundareshr!&lt;BR /&gt;
very close to my requirement, this will only streamstats 10 events, but I want to stats all event count, only show top 10 for each row.&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2016 03:09:05 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/hope-someone-could-help-me-How-can-reduce-records-in-each-row-in/m-p/286119#M86614</guid>
      <dc:creator>jujis008</dc:creator>
      <dc:date>2016-07-29T03:09:05Z</dc:date>
    </item>
  </channel>
</rss>

