<?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: Timechart already bucketed logs in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Timechart-already-bucketed-logs/m-p/77774#M19654</link>
    <description>&lt;P&gt;Well I think if you're doing the bucketing by hand with the bucket command,  you might as well go all the way and just use &lt;CODE&gt;stats count by _time, fieldA&lt;/CODE&gt; instead of &lt;CODE&gt;timechart count by fieldA&lt;/CODE&gt;.  &lt;/P&gt;

&lt;P&gt;The end result is the same, but when you use stats instead of timechart you'll be sure that &lt;EM&gt;really&lt;/EM&gt; isnt any more bucketing going on.  &lt;/P&gt;

&lt;P&gt;UPDATE - &lt;/P&gt;

&lt;P&gt;1) to get the "timechart showing the distinct count of field A for each value of field B",  you'd just do  &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;everything else&amp;gt; | stats dc(fieldA) by _time, fieldB&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;2) And the flash chart doesn't care whether the rows and columns come from &lt;CODE&gt;timechart&lt;/CODE&gt; or some manually bucketed and stats'ed search command.  If the table looks right the chart will look right.&lt;/P&gt;</description>
    <pubDate>Wed, 27 Oct 2010 01:22:47 GMT</pubDate>
    <dc:creator>sideview</dc:creator>
    <dc:date>2010-10-27T01:22:47Z</dc:date>
    <item>
      <title>Timechart already bucketed logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-already-bucketed-logs/m-p/77773#M19653</link>
      <description>&lt;P&gt;I have a query in which I use bucket to remove some duplicates at certain intervals.  I am now trying to timechart this data but I would like to use the buckets I already created rather than using the span or bins option on timechart.&lt;/P&gt;

&lt;P&gt;When not specifying a span or bins option timechart defaults and combines the buckets split by the bucket command.  Eg.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch |bucket _time span=5m | dedup _time fieldA fieldB | timechart count by fieldA
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;If I specify a span in the timechart command it seems to work better, however, I am not convinced timechart is not still combining buckets.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;mysearch |bucket _time span=5m | dedup _time fieldA fieldB | timechart span=5m count by fieldA
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What are my options here?&lt;/P&gt;

&lt;P&gt;As an example I have log entries that look like this. &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;timestamp fieldA=server1 fieldB=unitA 
timestamp fieldA=server1 fieldB=unitB 
timestamp fieldA=server2 fieldB=unitA 
timestamp fieldA=server2 fieldB=unitB 
timestamp fieldA=server2 fieldB=unitB 
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;What I am looking for is a timechart that shows the distinct count of fieldB for each value of fieldA in each bucket. So assuming all the entries above are in one bucket the value for server1 is 2 and for server2 is 2.&lt;/P&gt;</description>
      <pubDate>Tue, 26 Oct 2010 22:00:03 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-already-bucketed-logs/m-p/77773#M19653</guid>
      <dc:creator>christopherutz</dc:creator>
      <dc:date>2010-10-26T22:00:03Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart already bucketed logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-already-bucketed-logs/m-p/77774#M19654</link>
      <description>&lt;P&gt;Well I think if you're doing the bucketing by hand with the bucket command,  you might as well go all the way and just use &lt;CODE&gt;stats count by _time, fieldA&lt;/CODE&gt; instead of &lt;CODE&gt;timechart count by fieldA&lt;/CODE&gt;.  &lt;/P&gt;

&lt;P&gt;The end result is the same, but when you use stats instead of timechart you'll be sure that &lt;EM&gt;really&lt;/EM&gt; isnt any more bucketing going on.  &lt;/P&gt;

&lt;P&gt;UPDATE - &lt;/P&gt;

&lt;P&gt;1) to get the "timechart showing the distinct count of field A for each value of field B",  you'd just do  &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;&amp;lt;everything else&amp;gt; | stats dc(fieldA) by _time, fieldB&lt;/CODE&gt; &lt;/P&gt;

&lt;P&gt;2) And the flash chart doesn't care whether the rows and columns come from &lt;CODE&gt;timechart&lt;/CODE&gt; or some manually bucketed and stats'ed search command.  If the table looks right the chart will look right.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2010 01:22:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-already-bucketed-logs/m-p/77774#M19654</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2010-10-27T01:22:47Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart already bucketed logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-already-bucketed-logs/m-p/77775#M19655</link>
      <description>&lt;P&gt;This produces the correct table but I am really interested in the chart. Can I get to the chart from stats without using timechart?  I have edited the post with an example of what I am looking for.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2010 01:57:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-already-bucketed-logs/m-p/77775#M19655</guid>
      <dc:creator>christopherutz</dc:creator>
      <dc:date>2010-10-27T01:57:22Z</dc:date>
    </item>
    <item>
      <title>Re: Timechart already bucketed logs</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Timechart-already-bucketed-logs/m-p/77776#M19656</link>
      <description>&lt;P&gt;Updated my answer.  Indeed the Flash Chart doesnt know what the search language was - it just graphs the rows and columns it's given, so the combination of bucket and stats dc(fieldA) by _time, fieldB will work just fine in the chart.&lt;/P&gt;</description>
      <pubDate>Wed, 27 Oct 2010 02:10:31 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Timechart-already-bucketed-logs/m-p/77776#M19656</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2010-10-27T02:10:31Z</dc:date>
    </item>
  </channel>
</rss>

