<?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 limit my search to return only the top 10 events displaying count and percentage? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-my-search-to-return-only-the-top-10-events/m-p/135430#M37035</link>
    <description>&lt;P&gt;Thank you for reply,&lt;/P&gt;

&lt;P&gt;I tried to update the config file:&lt;BR /&gt;
splubk/etc/apps/search/default/props.conf&lt;BR /&gt;
    [splunk_web_service]&lt;BR /&gt;
      EXTRACT-raw=^[.&lt;EM&gt;?](?&lt;RAW&gt;.8&lt;/RAW&gt;&lt;/EM&gt;)&lt;/P&gt;

&lt;P&gt;And tried to search through the browser&lt;BR /&gt;
 source="/var/log/httpd/*-error_log" | top raw limit=10&lt;/P&gt;

&lt;P&gt;but no luck:&lt;BR /&gt;
No results found.&lt;/P&gt;

&lt;P&gt;I want to find the top 10 raw repeated in any log file such as Apache error log.&lt;/P&gt;

&lt;P&gt;Can you help me?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
    <pubDate>Mon, 28 Sep 2020 17:40:22 GMT</pubDate>
    <dc:creator>jalalallam</dc:creator>
    <dc:date>2020-09-28T17:40:22Z</dc:date>
    <item>
      <title>How to limit my search to return only the top 10 events displaying count and percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-my-search-to-return-only-the-top-10-events/m-p/135428#M37033</link>
      <description>&lt;P&gt;Hello,&lt;/P&gt;

&lt;P&gt;I would like to create a search that select the top 10 events &lt;/P&gt;

&lt;P&gt;Like this:&lt;/P&gt;

&lt;H2&gt;event                                                                                                                                                                                count  percent&lt;/H2&gt;

&lt;P&gt;[Mon Sep 22 17:14:36 2014] [error] [client XXX] File does not exist: /var/www/html/home-store                   1000       30&lt;BR /&gt;
[Mon Sep 22 15:53:37 2014] [error] [client XXX] Bean "Hits_Bean_List.__isset" does not support attrib         500        20&lt;/P&gt;

&lt;P&gt;Any suggestions? Any idea is welcome.&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:39:29 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-my-search-to-return-only-the-top-10-events/m-p/135428#M37033</guid>
      <dc:creator>jalalallam</dc:creator>
      <dc:date>2020-09-28T17:39:29Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit my search to return only the top 10 events displaying count and percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-my-search-to-return-only-the-top-10-events/m-p/135429#M37034</link>
      <description>&lt;P&gt;First, if timestamp does not matter, you may want to extract a fields, say called raw, that has only the event. I'm assuming the pattern above are for all your events. Example props.conf&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;[Insert Name of your sourcetype]
EXTRACT-raw=^\[.*?\](?P&amp;lt;raw&amp;gt;.*)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Then, simply run the search:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype="Insert name of your sourcetype"|top raw limit=10
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I'm not sure if this answers your question I don't know if all your events follow the pattern above. Nevertheless, the top command can get you there.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Sep 2014 17:36:18 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-my-search-to-return-only-the-top-10-events/m-p/135429#M37034</guid>
      <dc:creator>ndoshi</dc:creator>
      <dc:date>2014-09-22T17:36:18Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit my search to return only the top 10 events displaying count and percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-my-search-to-return-only-the-top-10-events/m-p/135430#M37035</link>
      <description>&lt;P&gt;Thank you for reply,&lt;/P&gt;

&lt;P&gt;I tried to update the config file:&lt;BR /&gt;
splubk/etc/apps/search/default/props.conf&lt;BR /&gt;
    [splunk_web_service]&lt;BR /&gt;
      EXTRACT-raw=^[.&lt;EM&gt;?](?&lt;RAW&gt;.8&lt;/RAW&gt;&lt;/EM&gt;)&lt;/P&gt;

&lt;P&gt;And tried to search through the browser&lt;BR /&gt;
 source="/var/log/httpd/*-error_log" | top raw limit=10&lt;/P&gt;

&lt;P&gt;but no luck:&lt;BR /&gt;
No results found.&lt;/P&gt;

&lt;P&gt;I want to find the top 10 raw repeated in any log file such as Apache error log.&lt;/P&gt;

&lt;P&gt;Can you help me?&lt;/P&gt;

&lt;P&gt;Thanks&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:40:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-my-search-to-return-only-the-top-10-events/m-p/135430#M37035</guid>
      <dc:creator>jalalallam</dc:creator>
      <dc:date>2020-09-28T17:40:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to limit my search to return only the top 10 events displaying count and percentage?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-limit-my-search-to-return-only-the-top-10-events/m-p/135431#M37036</link>
      <description>&lt;P&gt;Sorry, I had two typos in there. Change that in props.conf to what is now listed in the answer.&lt;/P&gt;

&lt;P&gt;You can use &lt;A href="http://regex101.com/" target="_blank"&gt;http://regex101.com/&lt;/A&gt; to test a regex (remove the ?P in the test regex). BTW, you should put your props.conf in $SPLUNK_HOME/etc/apps/search/local/props.conf&lt;/P&gt;

&lt;P&gt;Your search would be: sourcetype=splunk_web_service|top raw limit=10&lt;/P&gt;

&lt;P&gt;This assumes that your source "/var/log/httpd/*-error_log" is indeed tied to this sourcetype.&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:40:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-limit-my-search-to-return-only-the-top-10-events/m-p/135431#M37036</guid>
      <dc:creator>ndoshi</dc:creator>
      <dc:date>2020-09-28T17:40:41Z</dc:date>
    </item>
  </channel>
</rss>

