<?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 Equivalent Search Command for Excel Histogram (analysis toolpak addin) in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Equivalent-Search-Command-for-Excel-Histogram-analysis-toolpak/m-p/12226#M935</link>
    <description>&lt;P&gt;Anybody familiar with a Splunk search command that does the equivalent of the Excel Histogram function that is found in the Analysys Toolpak addin (options --&amp;gt; addin). This Excel function calculates data bins based on the min and max values of a data set, it then shows a count per bin.  For example.  If you had 1000 data points from 4820 to 71750, this would be the bin breakdown (for 6 bins).&lt;/P&gt;

&lt;P&gt;Bins&lt;BR /&gt;
4820    if &amp;lt;= 4820&lt;/P&gt;

&lt;P&gt;18206   if &amp;gt; 4820 &amp;amp; &amp;lt;= 18206&lt;/P&gt;

&lt;P&gt;31592   if &amp;gt;18206 &amp;amp; &amp;lt;= 31592&lt;/P&gt;

&lt;P&gt;44978   if &amp;gt; 31592 &amp;amp; &amp;lt;= 44978&lt;/P&gt;

&lt;P&gt;58364   if &amp;gt; 44978 &amp;amp; &amp;lt;= 58364&lt;/P&gt;

&lt;P&gt;71750   if &amp;gt; 58364 &amp;amp; &amp;lt;= 71750&lt;/P&gt;

&lt;P&gt;Now, we would need to determine the count of data points for bin, so we add frequency...&lt;/P&gt;

&lt;P&gt;Bin Frequency&lt;/P&gt;

&lt;P&gt;4820    2   if &amp;lt;= 4820&lt;/P&gt;

&lt;P&gt;18206   800 if &amp;gt; 4820 &amp;amp; &amp;lt;= 18206&lt;/P&gt;

&lt;P&gt;31592   100 if &amp;gt;18206 &amp;amp; &amp;lt;= 31592&lt;/P&gt;

&lt;P&gt;44978   47  if &amp;gt; 31592 &amp;amp; &amp;lt;= 44978&lt;/P&gt;

&lt;P&gt;58364   50  if &amp;gt; 44978 &amp;amp; &amp;lt;= 58364&lt;/P&gt;

&lt;P&gt;71750   1   if &amp;gt; 58364 &amp;amp; &amp;lt;= 71750&lt;/P&gt;

&lt;P&gt;With Splunk I am able to determine the min, max, and bin values, but I am having trouble figuring out the best way to go back through the raw data to count events per bin.  Not sure if there is a Splunk search command that will just do this or do I have to use a sub-search?&lt;/P&gt;

&lt;P&gt;Thanks in advance for any help.&lt;/P&gt;</description>
    <pubDate>Sat, 24 Apr 2010 03:13:08 GMT</pubDate>
    <dc:creator>kbecker</dc:creator>
    <dc:date>2010-04-24T03:13:08Z</dc:date>
    <item>
      <title>Equivalent Search Command for Excel Histogram (analysis toolpak addin)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Equivalent-Search-Command-for-Excel-Histogram-analysis-toolpak/m-p/12226#M935</link>
      <description>&lt;P&gt;Anybody familiar with a Splunk search command that does the equivalent of the Excel Histogram function that is found in the Analysys Toolpak addin (options --&amp;gt; addin). This Excel function calculates data bins based on the min and max values of a data set, it then shows a count per bin.  For example.  If you had 1000 data points from 4820 to 71750, this would be the bin breakdown (for 6 bins).&lt;/P&gt;

&lt;P&gt;Bins&lt;BR /&gt;
4820    if &amp;lt;= 4820&lt;/P&gt;

&lt;P&gt;18206   if &amp;gt; 4820 &amp;amp; &amp;lt;= 18206&lt;/P&gt;

&lt;P&gt;31592   if &amp;gt;18206 &amp;amp; &amp;lt;= 31592&lt;/P&gt;

&lt;P&gt;44978   if &amp;gt; 31592 &amp;amp; &amp;lt;= 44978&lt;/P&gt;

&lt;P&gt;58364   if &amp;gt; 44978 &amp;amp; &amp;lt;= 58364&lt;/P&gt;

&lt;P&gt;71750   if &amp;gt; 58364 &amp;amp; &amp;lt;= 71750&lt;/P&gt;

&lt;P&gt;Now, we would need to determine the count of data points for bin, so we add frequency...&lt;/P&gt;

&lt;P&gt;Bin Frequency&lt;/P&gt;

&lt;P&gt;4820    2   if &amp;lt;= 4820&lt;/P&gt;

&lt;P&gt;18206   800 if &amp;gt; 4820 &amp;amp; &amp;lt;= 18206&lt;/P&gt;

&lt;P&gt;31592   100 if &amp;gt;18206 &amp;amp; &amp;lt;= 31592&lt;/P&gt;

&lt;P&gt;44978   47  if &amp;gt; 31592 &amp;amp; &amp;lt;= 44978&lt;/P&gt;

&lt;P&gt;58364   50  if &amp;gt; 44978 &amp;amp; &amp;lt;= 58364&lt;/P&gt;

&lt;P&gt;71750   1   if &amp;gt; 58364 &amp;amp; &amp;lt;= 71750&lt;/P&gt;

&lt;P&gt;With Splunk I am able to determine the min, max, and bin values, but I am having trouble figuring out the best way to go back through the raw data to count events per bin.  Not sure if there is a Splunk search command that will just do this or do I have to use a sub-search?&lt;/P&gt;

&lt;P&gt;Thanks in advance for any help.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2010 03:13:08 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Equivalent-Search-Command-for-Excel-Histogram-analysis-toolpak/m-p/12226#M935</guid>
      <dc:creator>kbecker</dc:creator>
      <dc:date>2010-04-24T03:13:08Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent Search Command for Excel Histogram (analysis toolpak addin)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Equivalent-Search-Command-for-Excel-Histogram-analysis-toolpak/m-p/12227#M936</link>
      <description>&lt;P&gt;Yes, the &lt;CODE&gt;bucket&lt;/CODE&gt; command is what you're looking for.  Given the following search command (that generates synthetic data):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| windbag
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;An auto-extracted field is called &lt;CODE&gt;position&lt;/CODE&gt;, which is a monotonically increasing number from 0 to 99.  If you want to create 5 buckets of 20 numbers each:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| windbag | bucket position span=20 | stats count by position
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This produces a table of values like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;position    count
0-20        20
20-40       20
40-60       20
60-80       20
60-100      20
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;bucket&lt;/CODE&gt; command also handles time natively, so you can specify a relative time for the &lt;CODE&gt;span&lt;/CODE&gt; argument:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| bucket _time span=5m
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;You can read more about the &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Bucket" rel="nofollow"&gt;bucket command&lt;/A&gt; and about &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/Search/Specifytimemodifiersinyoursearch#Specify_relative_time_ranges_in_your_search" rel="nofollow"&gt;relative time identifiers&lt;/A&gt;.&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2010 04:17:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Equivalent-Search-Command-for-Excel-Histogram-analysis-toolpak/m-p/12227#M936</guid>
      <dc:creator>Johnvey</dc:creator>
      <dc:date>2010-04-24T04:17:43Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent Search Command for Excel Histogram (analysis toolpak addin)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Equivalent-Search-Command-for-Excel-Histogram-analysis-toolpak/m-p/12228#M937</link>
      <description>&lt;P&gt;... | chart count, max(datavalue), min(datavalue) over datavalue bins=6&lt;/P&gt;

&lt;P&gt;or &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;... | chart count(datavalue), max(datavalue), min(datavalue) over datavalue bins=6
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The &lt;CODE&gt;bins=&lt;/CODE&gt; can be replaced with fixed or logarithmic bucket sizes as well, see this for bucketing options: &lt;A href="http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Bucket" rel="nofollow"&gt;http://docs.splunk.com/Documentation/Splunk/5.0/SearchReference/Bucket&lt;/A&gt;&lt;/P&gt;</description>
      <pubDate>Sat, 24 Apr 2010 04:23:44 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Equivalent-Search-Command-for-Excel-Histogram-analysis-toolpak/m-p/12228#M937</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2010-04-24T04:23:44Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent Search Command for Excel Histogram (analysis toolpak addin)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Equivalent-Search-Command-for-Excel-Histogram-analysis-toolpak/m-p/12229#M938</link>
      <description>&lt;P&gt;Is there a way for Splunk to calculate the bins based on the min and max values of the position value?&lt;/P&gt;</description>
      <pubDate>Mon, 26 Apr 2010 21:34:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Equivalent-Search-Command-for-Excel-Histogram-analysis-toolpak/m-p/12229#M938</guid>
      <dc:creator>kbecker</dc:creator>
      <dc:date>2010-04-26T21:34:34Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent Search Command for Excel Histogram (analysis toolpak addin)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Equivalent-Search-Command-for-Excel-Histogram-analysis-toolpak/m-p/12230#M939</link>
      <description>&lt;P&gt;Yes, the bins generated will always be spaced such that the min and max values of whatever field of interest is covered.  Is there some specific method of binning that you're looking for?&lt;/P&gt;</description>
      <pubDate>Tue, 27 Apr 2010 02:33:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Equivalent-Search-Command-for-Excel-Histogram-analysis-toolpak/m-p/12230#M939</guid>
      <dc:creator>Johnvey</dc:creator>
      <dc:date>2010-04-27T02:33:24Z</dc:date>
    </item>
    <item>
      <title>Re: Equivalent Search Command for Excel Histogram (analysis toolpak addin)</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Equivalent-Search-Command-for-Excel-Histogram-analysis-toolpak/m-p/12231#M940</link>
      <description>&lt;P&gt;It looks like you want the buckets to be of even size. If for some reason you wanted to have more control over the bucket sizes/ranges (also useful to be able to lump outliers over a certain value into one "above X" bucket, you can do this, for example:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_your_search_ | fields some_field | eval some_field_group = case(some_field&amp;lt;50, "0-50ms", some_field&amp;lt;100, "50-100ms", some_field&amp;lt;150 , "100-150ms", some_field&amp;lt;200, "150-200ms", some_field&amp;lt;250, "200-250ms", some_field&amp;lt;500, "250-500ms", some_field&amp;lt;750, "500-750ms", some_field&amp;lt;1000, "750-1000ms", 1==1, "&amp;gt;1000ms" ) | chart count by some_field_group
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Thu, 26 May 2011 11:17:41 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Equivalent-Search-Command-for-Excel-Histogram-analysis-toolpak/m-p/12231#M940</guid>
      <dc:creator>Glenn</dc:creator>
      <dc:date>2011-05-26T11:17:41Z</dc:date>
    </item>
  </channel>
</rss>

