<?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: Does stats understand the % symbol? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/Does-stats-understand-the-symbol/m-p/138924#M38165</link>
    <description>&lt;P&gt;I think you'd want to strip the percent signs out.&lt;/P&gt;

&lt;P&gt;and if you're building chart, try using the chart or timechart instead of stats.  Stats will still work, but it's easy to get carried away with the by clauses.&lt;/P&gt;

&lt;P&gt;And I'd recommend you change the "list" to "avg" in order to assure you're only getting a single datapoint per time.  Multiple data points per time don't graph.&lt;/P&gt;

&lt;P&gt;so you'd end up with something like these (which are identical in output).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart avg(SysStatsUtilizationMemory) as MemUtil avg(SysStatsUtilizationCpu) as CPU_Util over _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;-or-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart avg(SysStatsUtilizationMemory) as MemUtil avg(SysStatsUtilizationCpu) as CPU_Util
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 11 Jul 2014 12:59:34 GMT</pubDate>
    <dc:creator>jimodonald</dc:creator>
    <dc:date>2014-07-11T12:59:34Z</dc:date>
    <item>
      <title>Does stats understand the % symbol?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-stats-understand-the-symbol/m-p/138921#M38162</link>
      <description>&lt;P&gt;Hi, &lt;BR /&gt;
My events actually report CPU and Mem utilization... 35.45%   and   25.56%&lt;BR /&gt;
I extract these over time but I don't get Lines on my chart.&lt;BR /&gt;
I'm wondering if these fields are read as text... so cant be graphed?&lt;BR /&gt;
My search is below&lt;/P&gt;

&lt;P&gt;CSCOacs_System_Statistics host="bob" | stats list(SysStatsUtilizationMemory) as MemUtil list(SysStatsUtilizationCpu) as CPU_Util by _time&lt;/P&gt;

&lt;P&gt;I'm wondering if I need to strip out the % from the results... or if I should be using a different tool... timechart or something.&lt;/P&gt;

&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:02:35 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-stats-understand-the-symbol/m-p/138921#M38162</guid>
      <dc:creator>mathewboarman</dc:creator>
      <dc:date>2020-09-28T17:02:35Z</dc:date>
    </item>
    <item>
      <title>Re: Does stats understand the % symbol?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-stats-understand-the-symbol/m-p/138922#M38163</link>
      <description>&lt;P&gt;You would need numerical data for displaying charts, be it using stats, chart, timechart or any other statistical command. I would suggest something like this:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CSCOacs_System_Statistics host="bob" | replace *% with * in SysStatsUtilizationMemory,SysStatsUtilizationCpu| stats list(SysStatsUtilizationMemory) as "MemUtil%" list(SysStatsUtilizationCpu) as "CPU_Util%" by _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Adding "%" to the labels will show % sign before the value (not same but close).&lt;/P&gt;

&lt;P&gt;&lt;STRONG&gt;Update&lt;/STRONG&gt;&lt;/P&gt;

&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;CSCOacs_System_Statistics host="bob" | replace *% with * in SysStatsUtilizationMemory,SysStatsUtilizationCpu| chart list(SysStatsUtilizationMemory) as "MemUtil%" list(SysStatsUtilizationCpu) as "CPU_Util%" over _time by host
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Jul 2014 12:54:14 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-stats-understand-the-symbol/m-p/138922#M38163</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-11T12:54:14Z</dc:date>
    </item>
    <item>
      <title>Re: Does stats understand the % symbol?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-stats-understand-the-symbol/m-p/138923#M38164</link>
      <description>&lt;P&gt;perfect, thank you&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2014 12:56:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-stats-understand-the-symbol/m-p/138923#M38164</guid>
      <dc:creator>mathewboarman</dc:creator>
      <dc:date>2014-07-11T12:56:48Z</dc:date>
    </item>
    <item>
      <title>Re: Does stats understand the % symbol?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-stats-understand-the-symbol/m-p/138924#M38165</link>
      <description>&lt;P&gt;I think you'd want to strip the percent signs out.&lt;/P&gt;

&lt;P&gt;and if you're building chart, try using the chart or timechart instead of stats.  Stats will still work, but it's easy to get carried away with the by clauses.&lt;/P&gt;

&lt;P&gt;And I'd recommend you change the "list" to "avg" in order to assure you're only getting a single datapoint per time.  Multiple data points per time don't graph.&lt;/P&gt;

&lt;P&gt;so you'd end up with something like these (which are identical in output).&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| chart avg(SysStatsUtilizationMemory) as MemUtil avg(SysStatsUtilizationCpu) as CPU_Util over _time
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;-or-&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;| timechart avg(SysStatsUtilizationMemory) as MemUtil avg(SysStatsUtilizationCpu) as CPU_Util
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 11 Jul 2014 12:59:34 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-stats-understand-the-symbol/m-p/138924#M38165</guid>
      <dc:creator>jimodonald</dc:creator>
      <dc:date>2014-07-11T12:59:34Z</dc:date>
    </item>
    <item>
      <title>Re: Does stats understand the % symbol?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-stats-understand-the-symbol/m-p/138925#M38166</link>
      <description>&lt;P&gt;... and is it possible to include the host in the label...&lt;/P&gt;

&lt;P&gt;ie ... as $host_CPU_Util% by time&lt;/P&gt;

&lt;P&gt;many thanks&lt;/P&gt;</description>
      <pubDate>Mon, 28 Sep 2020 17:02:38 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-stats-understand-the-symbol/m-p/138925#M38166</guid>
      <dc:creator>mathewboarman</dc:creator>
      <dc:date>2020-09-28T17:02:38Z</dc:date>
    </item>
    <item>
      <title>Re: Does stats understand the % symbol?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/Does-stats-understand-the-symbol/m-p/138926#M38167</link>
      <description>&lt;P&gt;Try the updated answer. I believe the output series will be like "CPU_Util%:hostName".&lt;/P&gt;</description>
      <pubDate>Fri, 11 Jul 2014 13:39:24 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/Does-stats-understand-the-symbol/m-p/138926#M38167</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2014-07-11T13:39:24Z</dc:date>
    </item>
  </channel>
</rss>

