<?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: Return top, middle, and bottom returns from query results using stats in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Return-top-middle-and-bottom-returns-from-query-results-using/m-p/700139#M237616</link>
    <description>&lt;P&gt;Please explain, with some examples, what is in "statistics", what you mean by "first", "last" and "middle" and how this relates to the two averages that your stats command is returning.&lt;/P&gt;</description>
    <pubDate>Wed, 25 Sep 2024 20:48:37 GMT</pubDate>
    <dc:creator>ITWhisperer</dc:creator>
    <dc:date>2024-09-25T20:48:37Z</dc:date>
    <item>
      <title>Return top, middle, and bottom returns from query results using stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-top-middle-and-bottom-returns-from-query-results-using/m-p/700138#M237615</link>
      <description>&lt;P&gt;I have this query&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;index=x host=y "searchTerm" | stats Avg(Field1) Avg(Field2)&lt;/LI-CODE&gt;
&lt;P&gt;which returns a count of N statistics.&lt;/P&gt;
&lt;P&gt;I would like modify my query such that&lt;/P&gt;
&lt;LI-CODE lang="markup"&gt;(first stats value) statistics[0], (middle stats value) ((statistics[0]+statistics[N])/length(statistics)), (final stats value) statistics(N)&lt;/LI-CODE&gt;
&lt;P&gt;are returned in the same query&lt;/P&gt;
&lt;P&gt;I have tried using head and tail but that still limits it to the specified value after 'head' or 'tail'. What other options are available?&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 23:03:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-top-middle-and-bottom-returns-from-query-results-using/m-p/700138#M237615</guid>
      <dc:creator>arkmenster</dc:creator>
      <dc:date>2024-09-25T23:03:25Z</dc:date>
    </item>
    <item>
      <title>Re: Return top, middle, and bottom returns from query results using stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-top-middle-and-bottom-returns-from-query-results-using/m-p/700139#M237616</link>
      <description>&lt;P&gt;Please explain, with some examples, what is in "statistics", what you mean by "first", "last" and "middle" and how this relates to the two averages that your stats command is returning.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 20:48:37 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-top-middle-and-bottom-returns-from-query-results-using/m-p/700139#M237616</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-09-25T20:48:37Z</dc:date>
    </item>
    <item>
      <title>Re: Return top, middle, and bottom returns from query results using stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-top-middle-and-bottom-returns-from-query-results-using/m-p/700144#M237618</link>
      <description>&lt;P&gt;Thanks &lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;&amp;nbsp;. So in the screenshot below, we see that 170 statistics were returned. I would like the query to return the 1st, the 85th/86th, and the 170th statistic, instead of all 170 of them. Is there a way to accomplish this?&lt;/P&gt;&lt;P&gt;&lt;span class="lia-inline-image-display-wrapper lia-image-align-inline" image-alt="sample" style="width: 999px;"&gt;&lt;img src="https://community.splunk.com/t5/image/serverpage/image-id/32811iAC4DB22E9D822D36/image-size/large?v=v2&amp;amp;px=999" role="button" title="sample.png" alt="sample" /&gt;&lt;span class="lia-inline-image-caption" onclick="event.preventDefault();"&gt;sample&lt;/span&gt;&lt;/span&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 21:01:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-top-middle-and-bottom-returns-from-query-results-using/m-p/700144#M237618</guid>
      <dc:creator>arkmenster</dc:creator>
      <dc:date>2024-09-25T21:01:41Z</dc:date>
    </item>
    <item>
      <title>Re: Return top, middle, and bottom returns from query results using stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-top-middle-and-bottom-returns-from-query-results-using/m-p/700146#M237619</link>
      <description>&lt;LI-CODE lang="markup"&gt;| streamstats count as row
| eventstats max(row) as total
| where row = 1 OR row = total OR row = floor(total / 2)&lt;/LI-CODE&gt;</description>
      <pubDate>Wed, 25 Sep 2024 21:37:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-top-middle-and-bottom-returns-from-query-results-using/m-p/700146#M237619</guid>
      <dc:creator>ITWhisperer</dc:creator>
      <dc:date>2024-09-25T21:37:11Z</dc:date>
    </item>
    <item>
      <title>Re: Return top, middle, and bottom returns from query results using stats</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Return-top-middle-and-bottom-returns-from-query-results-using/m-p/700147#M237620</link>
      <description>&lt;P&gt;Perfect. Thank you&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/225168"&gt;@ITWhisperer&lt;/a&gt;,&amp;nbsp;your solution worked.&lt;/P&gt;</description>
      <pubDate>Wed, 25 Sep 2024 21:41:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Return-top-middle-and-bottom-returns-from-query-results-using/m-p/700147#M237620</guid>
      <dc:creator>arkmenster</dc:creator>
      <dc:date>2024-09-25T21:41:34Z</dc:date>
    </item>
  </channel>
</rss>

