<?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: Values(x) showing too many results. Is there a way to limit the number of results to a field? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113034#M29697</link>
    <description>&lt;P&gt;I am not trying to limit the number of records returned as you can do with head and top.  This is an example of the date result and the field in this case that I want to limit is the "File Name".  So lets say I only wanted to return (x) number of file names.  For testing purposes lets say x=10&lt;/P&gt;

&lt;P&gt;Source      Number of Events      Method     Violated Policies  Destination     File Name&lt;BR /&gt;
Doe, John   25771                 MEDIA      HPolicyName1   WD My Passport  f:\myfilename1.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename2.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename3.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename4.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename5.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename6.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename7.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename8.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename9.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename10.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename11.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename12.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename13.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename14.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename15.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename16.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename17.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename18.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename19.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename20.msg - 813 KB&lt;/P&gt;</description>
    <pubDate>Tue, 31 Mar 2015 17:45:36 GMT</pubDate>
    <dc:creator>ivanayala</dc:creator>
    <dc:date>2015-03-31T17:45:36Z</dc:date>
    <item>
      <title>Values(x) showing too many results. Is there a way to limit the number of results to a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113031#M29694</link>
      <description>&lt;P&gt;I am trying to limit the number of results shown when I use the values command.  Here is my search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="mydata" earliest="-48h" latest=now
| stats count by Incident_ID Channel Source Destination File_Name Policies
| stats sum(count) as "Number of Events" values(Channel) as "Method" values(Policies) as "Violated Policies" values(Destination) as Destination values(File_Name) as "File Name" by Source
| convert timeformat="%H:%M:%S %d.%m.%Y." ctime(Time)
| sort - "Number of Events"
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The search works fine, but what i am having an issues with is when i get hundreds of results within a field.  Is there a way to limit the number of results to a field, say 10-15 results to a field?&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 17:00:04 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113031#M29694</guid>
      <dc:creator>ivanayala</dc:creator>
      <dc:date>2015-03-31T17:00:04Z</dc:date>
    </item>
    <item>
      <title>Re: Values(x) showing too many results. Is there a way to limit the number of results to a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113032#M29695</link>
      <description>&lt;P&gt;Hi ivanayala,&lt;BR /&gt;
 Try with &lt;STRONG&gt;top&lt;/STRONG&gt; command and add &lt;STRONG&gt;limit&lt;/STRONG&gt; attribut like example  &lt;CODE&gt;index=_internal | stats count by soucetype | top limit=  3 sourcetype&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 17:20:59 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113032#M29695</guid>
      <dc:creator>ngatchasandra</dc:creator>
      <dc:date>2015-03-31T17:20:59Z</dc:date>
    </item>
    <item>
      <title>Re: Values(x) showing too many results. Is there a way to limit the number of results to a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113033#M29696</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;Try with:&lt;BR /&gt;
         index="mydata" earliest="-48h" latest=now&lt;BR /&gt;
        | stats count by Incident_ID Channel Source Destination File_Name Policies&lt;BR /&gt;
        | stats sum(count) as "Number of Events" values(Channel) as "Method" values(Policies) as "Violated Policies" values(Destination) as Destination values(File_Name) as "File Name" by Source&lt;BR /&gt;
        | convert timeformat="%H:%M:%S %d.%m.%Y." ctime(Time)&lt;BR /&gt;
        | sort - "Number of Events"| head 15&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 19:23:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113033#M29696</guid>
      <dc:creator>Patient</dc:creator>
      <dc:date>2020-09-28T19:23:28Z</dc:date>
    </item>
    <item>
      <title>Re: Values(x) showing too many results. Is there a way to limit the number of results to a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113034#M29697</link>
      <description>&lt;P&gt;I am not trying to limit the number of records returned as you can do with head and top.  This is an example of the date result and the field in this case that I want to limit is the "File Name".  So lets say I only wanted to return (x) number of file names.  For testing purposes lets say x=10&lt;/P&gt;

&lt;P&gt;Source      Number of Events      Method     Violated Policies  Destination     File Name&lt;BR /&gt;
Doe, John   25771                 MEDIA      HPolicyName1   WD My Passport  f:\myfilename1.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename2.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename3.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename4.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename5.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename6.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename7.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename8.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename9.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename10.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename11.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename12.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename13.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename14.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename15.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename16.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename17.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename18.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename19.msg - 813 KB&lt;BR /&gt;
                                                                                f:\myfilename20.msg - 813 KB&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 17:45:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113034#M29697</guid>
      <dc:creator>ivanayala</dc:creator>
      <dc:date>2015-03-31T17:45:36Z</dc:date>
    </item>
    <item>
      <title>Re: Values(x) showing too many results. Is there a way to limit the number of results to a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113035#M29698</link>
      <description>&lt;P&gt;I added some more information to my question.  Thank you for replying.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 17:46:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113035#M29698</guid>
      <dc:creator>ivanayala</dc:creator>
      <dc:date>2015-03-31T17:46:11Z</dc:date>
    </item>
    <item>
      <title>Re: Values(x) showing too many results. Is there a way to limit the number of results to a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113036#M29699</link>
      <description>&lt;P&gt;I added some more information to my question.  Thank you for replying.&lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 17:46:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113036#M29699</guid>
      <dc:creator>ivanayala</dc:creator>
      <dc:date>2015-03-31T17:46:18Z</dc:date>
    </item>
    <item>
      <title>Re: Values(x) showing too many results. Is there a way to limit the number of results to a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113037#M29700</link>
      <description>&lt;P&gt;Hi, patient and Sandrine&lt;BR /&gt;
Limit and head as you used affect the number of event not the number of values of a given field.&lt;/P&gt;

&lt;P&gt;the function value(X) gives us  the list of all distinct values of the field X as a multi-value entry. So what ivanayala need is to reduce or limit that number of values.  &lt;/P&gt;</description>
      <pubDate>Tue, 31 Mar 2015 18:50:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113037#M29700</guid>
      <dc:creator>stephane_cyrill</dc:creator>
      <dc:date>2015-03-31T18:50:29Z</dc:date>
    </item>
    <item>
      <title>Re: Values(x) showing too many results. Is there a way to limit the number of results to a field?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113038#M29701</link>
      <description>&lt;P&gt;you can select a subset range of values in a multivalued field using mvindex. This example creates mv fields of all computers in the same subnet, then takes the first 3 as examples of computers in that subnet.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;. . . | table computer_name subnet
      | mvcombine computer_name
      | eval examples = mvindex( computer_name, 0, 2 ) 
      | fields - computer_name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Mon, 13 Feb 2017 21:48:15 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Values-x-showing-too-many-results-Is-there-a-way-to-limit-the/m-p/113038#M29701</guid>
      <dc:creator>templets</dc:creator>
      <dc:date>2017-02-13T21:48:15Z</dc:date>
    </item>
  </channel>
</rss>

