<?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: Search first 10 results by sourcetype in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Search-first-10-results-by-sourcetype/m-p/159537#M45037</link>
    <description>&lt;P&gt;You need to specify a field for the top command, maybe you wanted this:&lt;/P&gt;

&lt;P&gt;|top limit=10 _raw by sourcetype&lt;/P&gt;</description>
    <pubDate>Wed, 25 Feb 2015 15:17:25 GMT</pubDate>
    <dc:creator>gfuente</dc:creator>
    <dc:date>2015-02-25T15:17:25Z</dc:date>
    <item>
      <title>Search first 10 results by sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-first-10-results-by-sourcetype/m-p/159535#M45035</link>
      <description>&lt;P&gt;Hello I have question regarding limiting the number of events on search to reduce the search time.&lt;/P&gt;

&lt;P&gt;Currently, I'm trying to get summary of sourcetype for their eps(events per sec) and log stoppage.&lt;/P&gt;

&lt;P&gt;Here is the query I'm using currently.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;sourcetype=firewall:web1|head 10|stats sparkline count, first(_time) AS LastTime last(_time) as FirstTime values(index) AS Index values(sourcetype) AS SourceType |eval timediff=now()-LastTime|eval duration=LastTime-FirstTime|eval eps=10/duration|fields Index SourceType FirstTime sparkline LastTime duration eps timediff|convert ctime(FirstTime) ctime(LastTime)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Above query gives me the details of the logging activity and I have tried to reduce search time by applying &lt;CODE&gt;|head 10&lt;/CODE&gt;&lt;BR /&gt;
The problem is that I have dozens of sourcetype and would like to get the summary for all the sourcetype I have.&lt;BR /&gt;
However, as I used sourceytpe=*, I can only get first few sourcetype because I have limited search for the first 10 events, not for 10 events per sourcetype. &lt;BR /&gt;
Is there a way to limit number of events on search by fields such as index or sourcetype?&lt;BR /&gt;
I've made dashboard with a table applying above query for each sourcetype (one table per sourcetype) but it's taking forever. &lt;BR /&gt;
Any suggestion?&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 14:19:28 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-first-10-results-by-sourcetype/m-p/159535#M45035</guid>
      <dc:creator>hcheang</dc:creator>
      <dc:date>2015-02-25T14:19:28Z</dc:date>
    </item>
    <item>
      <title>Re: Search first 10 results by sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-first-10-results-by-sourcetype/m-p/159536#M45036</link>
      <description>&lt;P&gt;Can you use &lt;EM&gt;top&lt;/EM&gt; instead of &lt;EM&gt;head&lt;/EM&gt; like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;...|top limit=10 by sourcetype|...
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Wed, 25 Feb 2015 15:10:17 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-first-10-results-by-sourcetype/m-p/159536#M45036</guid>
      <dc:creator>sanjay_shrestha</dc:creator>
      <dc:date>2015-02-25T15:10:17Z</dc:date>
    </item>
    <item>
      <title>Re: Search first 10 results by sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-first-10-results-by-sourcetype/m-p/159537#M45037</link>
      <description>&lt;P&gt;You need to specify a field for the top command, maybe you wanted this:&lt;/P&gt;

&lt;P&gt;|top limit=10 _raw by sourcetype&lt;/P&gt;</description>
      <pubDate>Wed, 25 Feb 2015 15:17:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-first-10-results-by-sourcetype/m-p/159537#M45037</guid>
      <dc:creator>gfuente</dc:creator>
      <dc:date>2015-02-25T15:17:25Z</dc:date>
    </item>
    <item>
      <title>Re: Search first 10 results by sourcetype</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Search-first-10-results-by-sourcetype/m-p/159538#M45038</link>
      <description>&lt;P&gt;Actually I found easier way!.&lt;/P&gt;

&lt;P&gt;I tried dedup 10 sourcetype and it worked like magic.&lt;/P&gt;

&lt;P&gt;Thanks for the answers, too!&lt;/P&gt;</description>
      <pubDate>Thu, 26 Feb 2015 12:47:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Search-first-10-results-by-sourcetype/m-p/159538#M45038</guid>
      <dc:creator>hcheang</dc:creator>
      <dc:date>2015-02-26T12:47:38Z</dc:date>
    </item>
  </channel>
</rss>

