<?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: Display calculated values in a timechart in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Display-calculated-values-in-a-timechart/m-p/32929#M6950</link>
    <description>&lt;P&gt;Is your summary index created using one of the &lt;CODE&gt;si-&lt;/CODE&gt; commands (&lt;CODE&gt;sistats&lt;/CODE&gt;, &lt;CODE&gt;sitimechart&lt;/CODE&gt;, &lt;CODE&gt;sichart&lt;/CODE&gt;) or one of the conventional ones? (&lt;CODE&gt;stats&lt;/CODE&gt;, etc.)? It appears to be the latter, but can you confirm?&lt;/P&gt;</description>
    <pubDate>Thu, 27 Jan 2011 00:32:22 GMT</pubDate>
    <dc:creator>gkanapathy</dc:creator>
    <dc:date>2011-01-27T00:32:22Z</dc:date>
    <item>
      <title>Display calculated values in a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-calculated-values-in-a-timechart/m-p/32928#M6949</link>
      <description>&lt;P&gt;We have data in the summary index that counts information by various categories. For the purposes of presenting the problem we collect information in 15-minute buckets, and each event includes HostName, HostType, and count which is the number of occurrences of the HostName, HostType combination in that bucket.  So a sample event would be&lt;/P&gt;

&lt;BLOCKQUOTE&gt;
  &lt;P&gt;08:15:00 ... HostName="Alpha" HostType="foo" count=47 ...&lt;/P&gt;
&lt;/BLOCKQUOTE&gt;

&lt;P&gt;HostNames can be any of a variety of Strings, and HostType can be either "foo" or "bar".  I am trying to write a search that plots the percentage of "foo" in each bucket using a timechart.  So far we have &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary 
| bucket span=15m _time 
| eval NumFoo=if(match(Node_Type,"foo"),count,0) 
| eval NumBar=if(match(Node_Type,"bar"),count,0) 
| eval PercentFoo=(NumFoo/(NumFoo+NumBar)) 
| timechart span=15m PercentFoo
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;As written, Splunk complains that "The specifier 'Offload' is invalid. It must be in form (). For example: max(size)."  If I remove the timechart of the search above and instead pipe to &lt;CODE&gt;| chart max(NumFoo), max(NumBar), max(PercentFoo) by _time&lt;/CODE&gt; I can see values for NumFoo and NumBar so the variables seem to be populated.  I don't think using &lt;CODE&gt;timechart max(PercentFoo)&lt;/CODE&gt; or any other  operation on PercentFoo is appropriate - I have a value calculated I just need to display it.  Any guidance on how to accomplish this is greatly appreciated.&lt;/P&gt;</description>
      <pubDate>Wed, 26 Jan 2011 23:52:12 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-calculated-values-in-a-timechart/m-p/32928#M6949</guid>
      <dc:creator>beaumaris</dc:creator>
      <dc:date>2011-01-26T23:52:12Z</dc:date>
    </item>
    <item>
      <title>Re: Display calculated values in a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-calculated-values-in-a-timechart/m-p/32929#M6950</link>
      <description>&lt;P&gt;Is your summary index created using one of the &lt;CODE&gt;si-&lt;/CODE&gt; commands (&lt;CODE&gt;sistats&lt;/CODE&gt;, &lt;CODE&gt;sitimechart&lt;/CODE&gt;, &lt;CODE&gt;sichart&lt;/CODE&gt;) or one of the conventional ones? (&lt;CODE&gt;stats&lt;/CODE&gt;, etc.)? It appears to be the latter, but can you confirm?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2011 00:32:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-calculated-values-in-a-timechart/m-p/32929#M6950</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-01-27T00:32:22Z</dc:date>
    </item>
    <item>
      <title>Re: Display calculated values in a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-calculated-values-in-a-timechart/m-p/32930#M6951</link>
      <description>&lt;P&gt;I believe you should be able to do:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index=summary | timechart span=15m sum(count) by Node_Type | eval PercentFoo=foo/(foo+bar)
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;though if your example is too much simplified from your actual use case, there will have to be some adjustments made to make this work.&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2011 00:36:36 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-calculated-values-in-a-timechart/m-p/32930#M6951</guid>
      <dc:creator>gkanapathy</dc:creator>
      <dc:date>2011-01-27T00:36:36Z</dc:date>
    </item>
    <item>
      <title>Re: Display calculated values in a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-calculated-values-in-a-timechart/m-p/32931#M6952</link>
      <description>&lt;P&gt;It's a little strange to do the bucketing manually and then give it to timechart who'll want to bucket it again.  But you could maybe replace the timechart with &lt;CODE&gt;stats first(PercentFoo) as PercentFoo first(PercentBar) as PercentBar by _time&lt;/CODE&gt;.  Since the first bucket will have done the bucketing, timechart and it's second &lt;CODE&gt;span=15m&lt;/CODE&gt; clause isnt going to do anything anyway that the stats clause wouldnt do.  &lt;/P&gt;

&lt;P&gt;Or maybe you could not do the initial bucketing but leave the work to timechart.  This is the way I would go:  &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=summary (HostType="foo" OR HostType="bar" ) |  timechart count span=15m by HostType&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;a nice stacked area chart of that might be all you need,  but you could also do this: &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=summary (HostType="foo" OR HostType="bar" ) |  timechart count span=15m by HostType | addtotals | eval=fooPercent=foo*100/Total | eval barPercent=bar*100/Total&lt;/CODE&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2011 00:37:02 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-calculated-values-in-a-timechart/m-p/32931#M6952</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-01-27T00:37:02Z</dc:date>
    </item>
    <item>
      <title>Re: Display calculated values in a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-calculated-values-in-a-timechart/m-p/32932#M6953</link>
      <description>&lt;P&gt;Great approach Nick, leaves me with a new question.  When I adopt your second search style, I can use the 'fields' command to get a table with 2 columns: _time and fooPercent.  However when I do "Show Report" it no longer seems to understand this is a timechart of fooPercent over _time, presumably because this was not in the original timechart command early in the search string.  Can you recommend a way to get the graph of fooPercent over _time that we desire?&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2011 02:46:23 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-calculated-values-in-a-timechart/m-p/32932#M6953</guid>
      <dc:creator>beaumaris</dc:creator>
      <dc:date>2011-01-27T02:46:23Z</dc:date>
    </item>
    <item>
      <title>Re: Display calculated values in a timechart</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Display-calculated-values-in-a-timechart/m-p/32933#M6954</link>
      <description>&lt;P&gt;The summary index is created using the conventional commands&lt;/P&gt;</description>
      <pubDate>Thu, 27 Jan 2011 02:51:20 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Display-calculated-values-in-a-timechart/m-p/32933#M6954</guid>
      <dc:creator>beaumaris</dc:creator>
      <dc:date>2011-01-27T02:51:20Z</dc:date>
    </item>
  </channel>
</rss>

