<?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: Splunk Head command in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Head-command/m-p/665973#M228475</link>
    <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249850"&gt;@SplunkSN&lt;/a&gt;&amp;nbsp; as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;says, the head command does not limit the columns/fields retrieved, it simply takes the first n results, so in your timechart case, it will return the&amp;nbsp;&lt;STRONG&gt;earliest&lt;/STRONG&gt; 15 rows of your timechart, so effectively 15 rows of 15 minute spans.&lt;/P&gt;&lt;P&gt;if you want to control the highest count of the dest_domain, you can use a where clause in the timechart, like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| timechart span=15m count by dest_domain usenull=f useother=f where count in top10&lt;/LI-CODE&gt;&lt;P&gt;which will show you the 10 &lt;STRONG&gt;dest_domain&lt;/STRONG&gt;&amp;nbsp;values that have the highest count.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Tue, 24 Oct 2023 08:09:11 GMT</pubDate>
    <dc:creator>bowesmana</dc:creator>
    <dc:date>2023-10-24T08:09:11Z</dc:date>
    <item>
      <title>Splunk Head command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Head-command/m-p/665895#M228462</link>
      <description>&lt;P&gt;Hi All,&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Splunk "head" command by default retrieves top 10 columns and 10 results. may i know if we can control the number of columns to be retrieved.&lt;/P&gt;&lt;P&gt;index= &amp;lt;Splunk query&amp;gt;| timechart span=15m count by dest_domain usenull=f useother=f | head 15&lt;/P&gt;&lt;P&gt;e.g.&lt;/P&gt;&lt;P&gt;_time|column1|...............................................................|coulmn15&lt;BR /&gt;1&lt;/P&gt;&lt;P&gt;2&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;-&lt;/P&gt;&lt;P&gt;15&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 16:53:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Head-command/m-p/665895#M228462</guid>
      <dc:creator>SplunkSN</dc:creator>
      <dc:date>2023-10-23T16:53:24Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Head command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Head-command/m-p/665897#M228463</link>
      <description>&lt;P&gt;To be pedantic, Splunk doesn't have "columns" in the DBA sense.&amp;nbsp; We call them "fields".&lt;/P&gt;&lt;P&gt;The &lt;FONT face="courier new,courier"&gt;head&lt;/FONT&gt; command returns all fields in the first &lt;FONT face="courier new,courier"&gt;n&lt;/FONT&gt; results.&amp;nbsp; The fields to return can be controlled with the &lt;FONT face="courier new,courier"&gt;fields&lt;/FONT&gt; command.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= &amp;lt;Splunk query&amp;gt;
| fields _time column1 column2 ... column15
| timechart span=15m count by dest_domain usenull=f useother=f 
| head 15&lt;/LI-CODE&gt;&lt;P&gt;In this case, however, &lt;FONT face="courier new,courier"&gt;head&lt;/FONT&gt; is unnecessary because &lt;FONT face="courier new,courier"&gt;timechart&lt;/FONT&gt; can do the same thing.&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= &amp;lt;Splunk query&amp;gt;
| fields _time column1 column2 ... column15
| timechart limit=15 span=15m count by dest_domain usenull=f useother=f &lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 17:02:25 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Head-command/m-p/665897#M228463</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2023-10-23T17:02:25Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Head command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Head-command/m-p/665900#M228464</link>
      <description>&lt;P&gt;Are you interested in leaving out &lt;EM&gt;dest_domain&amp;nbsp;&lt;/EM&gt;values that don't have high counts?&amp;nbsp; A real simple way to approach it is to "pre-count" the &lt;EM&gt;dest_domain&lt;/EM&gt; using &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Eventstats" target="_self"&gt;eventstats&lt;/A&gt;, and limit just those that had more than a particular threshold (in this case 100) with the &lt;A href="https://docs.splunk.com/Documentation/Splunk/latest/SearchReference/Where" target="_self"&gt;where&lt;/A&gt; command:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;index= &amp;lt;Splunk query&amp;gt;
| eventstats count by sourcetype
| where count&amp;gt;100
| timechart span=15m count by dest_domain usenull=f useother=f | head 15&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Also, when you think about how Splunk is running these commands, you might visualize it running these commands over and over your data...like several for-loops one right after another.&amp;nbsp; That's what it does.&amp;nbsp; That's what it is optimized for...it's a bit counterintuitive compared to databases where you are trying to limit full-scans of things.&amp;nbsp; The distributed architecture of Splunk is built for this.&lt;/P&gt;</description>
      <pubDate>Mon, 23 Oct 2023 17:31:54 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Head-command/m-p/665900#M228464</guid>
      <dc:creator>_JP</dc:creator>
      <dc:date>2023-10-23T17:31:54Z</dc:date>
    </item>
    <item>
      <title>Re: Splunk Head command</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Splunk-Head-command/m-p/665973#M228475</link>
      <description>&lt;P&gt;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/249850"&gt;@SplunkSN&lt;/a&gt;&amp;nbsp; as&amp;nbsp;&lt;a href="https://community.splunk.com/t5/user/viewprofilepage/user-id/213957"&gt;@richgalloway&lt;/a&gt;&amp;nbsp;says, the head command does not limit the columns/fields retrieved, it simply takes the first n results, so in your timechart case, it will return the&amp;nbsp;&lt;STRONG&gt;earliest&lt;/STRONG&gt; 15 rows of your timechart, so effectively 15 rows of 15 minute spans.&lt;/P&gt;&lt;P&gt;if you want to control the highest count of the dest_domain, you can use a where clause in the timechart, like this&lt;/P&gt;&lt;LI-CODE lang="markup"&gt;| timechart span=15m count by dest_domain usenull=f useother=f where count in top10&lt;/LI-CODE&gt;&lt;P&gt;which will show you the 10 &lt;STRONG&gt;dest_domain&lt;/STRONG&gt;&amp;nbsp;values that have the highest count.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Tue, 24 Oct 2023 08:09:11 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Splunk-Head-command/m-p/665973#M228475</guid>
      <dc:creator>bowesmana</dc:creator>
      <dc:date>2023-10-24T08:09:11Z</dc:date>
    </item>
  </channel>
</rss>

