<?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 Chart using variable units in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Chart-using-variable-units/m-p/50685#M12183</link>
    <description>&lt;P&gt;I'm trying to create a dashboard that will allow a user to select a machine or set of machines and see a timechart of how much data they have on our system and how this has evolved. The problem is that depending on what the user selects, we may be talking about anything from a few megabytes to a few petabytes.&lt;/P&gt;

&lt;P&gt;I'd like to be able to intelligently pick the best unit for the chart (ie. 1PB, 1TB, etc.) so as to avoid having labels like "1.074E9 MB" or "9.31E-10 PB". What would be the best way of doing this?&lt;/P&gt;</description>
    <pubDate>Fri, 29 Jul 2011 16:29:14 GMT</pubDate>
    <dc:creator>alexiri</dc:creator>
    <dc:date>2011-07-29T16:29:14Z</dc:date>
    <item>
      <title>Chart using variable units</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-using-variable-units/m-p/50685#M12183</link>
      <description>&lt;P&gt;I'm trying to create a dashboard that will allow a user to select a machine or set of machines and see a timechart of how much data they have on our system and how this has evolved. The problem is that depending on what the user selects, we may be talking about anything from a few megabytes to a few petabytes.&lt;/P&gt;

&lt;P&gt;I'd like to be able to intelligently pick the best unit for the chart (ie. 1PB, 1TB, etc.) so as to avoid having labels like "1.074E9 MB" or "9.31E-10 PB". What would be the best way of doing this?&lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2011 16:29:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-using-variable-units/m-p/50685#M12183</guid>
      <dc:creator>alexiri</dc:creator>
      <dc:date>2011-07-29T16:29:14Z</dc:date>
    </item>
    <item>
      <title>Re: Chart using variable units</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-using-variable-units/m-p/50686#M12184</link>
      <description>&lt;P&gt;See the docs for the &lt;CODE&gt;case()&lt;/CODE&gt; function within the &lt;CODE&gt;eval&lt;/CODE&gt; command: &lt;/P&gt;

&lt;P&gt;&lt;A href="http://www.splunk.com/base/Documentation/latest/SearchReference/CommonEvalFunctions"&gt;http://www.splunk.com/base/Documentation/latest/SearchReference/CommonEvalFunctions&lt;/A&gt;&lt;/P&gt;

&lt;P&gt;Here's a simple search to show the idea.  This displays throughput in KB when the numbers are small and in MB when they're large:  &lt;/P&gt;

&lt;P&gt;&lt;CODE&gt;index=_internal source=*metrics.log group=per_sourcetype_thruput | stats sum(kb) as kb by series | eval totalKB=case(kb&amp;lt;5000, tostring(kb)+" KB",kb&amp;gt;=5000,tostring(kb/1024)+ " MB")&lt;/CODE&gt;&lt;/P&gt;

&lt;P&gt;the &lt;CODE&gt;case&lt;/CODE&gt; function can take any number of argument pairs so this should give you what you need.  &lt;/P&gt;</description>
      <pubDate>Fri, 29 Jul 2011 19:56:43 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-using-variable-units/m-p/50686#M12184</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2011-07-29T19:56:43Z</dc:date>
    </item>
    <item>
      <title>Re: Chart using variable units</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-using-variable-units/m-p/50687#M12185</link>
      <description>&lt;P&gt;Hi @nick,&lt;/P&gt;

&lt;P&gt;Thanks for your reply. This would work fine for displaying the data in a table, but what I want is to display it in a chart.&lt;/P&gt;

&lt;P&gt;What I want is to be able to change the units of the Y axis depending on what makes sense. If I have to graph data that goes from 2097152 MB to 38797312 MB, I'd like the scale to go from 0 TB to, say, 40 TB.&lt;/P&gt;

&lt;P&gt;Can this be done? I'm using advanced views, in case that makes a difference.&lt;/P&gt;</description>
      <pubDate>Mon, 01 Aug 2011 14:36:47 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-using-variable-units/m-p/50687#M12185</guid>
      <dc:creator>alexiri</dc:creator>
      <dc:date>2011-08-01T14:36:47Z</dc:date>
    </item>
    <item>
      <title>Re: Chart using variable units</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-using-variable-units/m-p/50688#M12186</link>
      <description>&lt;P&gt;I would love to be able display numbers with the SI unit.&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2012 12:18:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-using-variable-units/m-p/50688#M12186</guid>
      <dc:creator>rtelford</dc:creator>
      <dc:date>2012-12-19T12:18:38Z</dc:date>
    </item>
    <item>
      <title>Re: Chart using variable units</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Chart-using-variable-units/m-p/50689#M12187</link>
      <description>&lt;P&gt;Yes it can be done.  You can use the eventstats command after your stats command, to paint a little "maxKb" field onto every row.   Then you can do your conditional eval, except that the eval will check the maxKb value and make the choice based on that. Then once the eval has made the scaling change (or not),  then use the fields command to remove the maxKb field.   However without doing a little more work the user won't know which scale they're looking at - TB or GB.  (A bit more eval, and then a Sideview ResultsValueSetter and a Sideview HTML module could solve that though.)&lt;/P&gt;</description>
      <pubDate>Wed, 19 Dec 2012 17:39:55 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Chart-using-variable-units/m-p/50689#M12187</guid>
      <dc:creator>sideview</dc:creator>
      <dc:date>2012-12-19T17:39:55Z</dc:date>
    </item>
  </channel>
</rss>

