<?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: How to calculate the number of CPU cores for cluster, over time? in Splunk Search</title>
    <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-number-of-CPU-cores-for-cluster-over-time/m-p/426889#M122295</link>
    <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="vmware-inv" sourcetype="vmware:inv:vm" eventtype=vmware_inventory power_state=poweredOn
| bucket span=1d _time | dedup _time vm_name,cluster_name,cpu_cores,_time
 | timechart span=1d sum(cpu_cores) by cluster_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="vmware-inv" sourcetype="vmware:inv:vm" eventtype=vmware_inventory power_state=poweredOn
 | bucket span=1d _time
 | stats count by vm_name,cluster_name,cpu_cores,_time
 | timechart span=1d sum(cpu_cores) by cluster_name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
    <pubDate>Fri, 01 Jun 2018 21:21:48 GMT</pubDate>
    <dc:creator>somesoni2</dc:creator>
    <dc:date>2018-06-01T21:21:48Z</dc:date>
    <item>
      <title>How to calculate the number of CPU cores for cluster, over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-number-of-CPU-cores-for-cluster-over-time/m-p/426886#M122292</link>
      <description>&lt;P&gt;This should be a simple query but I seem unable to get the correct results when I try and display over time.&lt;/P&gt;

&lt;P&gt;This search works and shows me the correct amount of cores for each cluster (a cluster can be made up of many VM's):&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="vmware-inv" sourcetype="vmware:inv:vm" eventtype=vmware_inventory power_state=poweredOn
| stats count by vm_name,cluster_name,cpu_cores
| stats sum(cpu_cores) by cluster_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This would like like:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;Cluster Name | Cores
Cluster1 | 100
Cluster2 | 200
Cluster3 | 150
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;The problem starts when I try and chart this over time, because there are multiple events a day, it seems to take the sum of all of the events so the core are 1000's:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="vmware-inv" sourcetype="vmware:inv:vm" eventtype=vmware_inventory power_state=poweredOn
| stats count by vm_name,cluster_name,cpu_cores,_time
| timechart span=1d sum(cpu_cores) by cluster_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;This looks like&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time | Cluster1 | Cluster2 | Cluster3
2018-05-31 | 1200 | 2000 | 1750
2018-05-30 | 800 | 1700 | 1520
2018-05-29 | 1500 | 2100 | 1890
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;But it should be the same, the sum in the first query, e.g.&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;_time | Cluster1 | Cluster2 | Cluster3
2018-05-31 | 100 | 200 | 150
2018-05-30 | 100 | 200 | 150
2018-05-29 | 100 | 200 | 150
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;I am sure this is a simple fix, please let me know what's going wrong here.&lt;/P&gt;

&lt;P&gt;Thanks!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 19:00:26 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-number-of-CPU-cores-for-cluster-over-time/m-p/426886#M122292</guid>
      <dc:creator>johnansett</dc:creator>
      <dc:date>2018-06-01T19:00:26Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the number of CPU cores for cluster, over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-number-of-CPU-cores-for-cluster-over-time/m-p/426887#M122293</link>
      <description>&lt;P&gt;Instead of &lt;CODE&gt;sum(cpu_cores)&lt;/CODE&gt;, perhaps &lt;CODE&gt;min(cpu_cores)&lt;/CODE&gt; would be more accurate.&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 20:10:32 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-number-of-CPU-cores-for-cluster-over-time/m-p/426887#M122293</guid>
      <dc:creator>richgalloway</dc:creator>
      <dc:date>2018-06-01T20:10:32Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the number of CPU cores for cluster, over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-number-of-CPU-cores-for-cluster-over-time/m-p/426888#M122294</link>
      <description>&lt;P&gt;Unfortunately that won't work, it gives me a value of the minimum value for the cpu_core field, which is ~1 - 12 depending on the type of VM's... what I want to understand is how many total vCPU's are allocated for the cluster.  The field cpu_core has a value of the number of vCPU's on each VM, there might be 200 - 1000 VM's per cluster.&lt;/P&gt;</description>
      <pubDate>Tue, 29 Sep 2020 19:45:22 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-number-of-CPU-cores-for-cluster-over-time/m-p/426888#M122294</guid>
      <dc:creator>johnansett</dc:creator>
      <dc:date>2020-09-29T19:45:22Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the number of CPU cores for cluster, over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-number-of-CPU-cores-for-cluster-over-time/m-p/426889#M122295</link>
      <description>&lt;P&gt;Give this a try&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="vmware-inv" sourcetype="vmware:inv:vm" eventtype=vmware_inventory power_state=poweredOn
| bucket span=1d _time | dedup _time vm_name,cluster_name,cpu_cores,_time
 | timechart span=1d sum(cpu_cores) by cluster_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;OR &lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="vmware-inv" sourcetype="vmware:inv:vm" eventtype=vmware_inventory power_state=poweredOn
 | bucket span=1d _time
 | stats count by vm_name,cluster_name,cpu_cores,_time
 | timechart span=1d sum(cpu_cores) by cluster_name
&lt;/CODE&gt;&lt;/PRE&gt;</description>
      <pubDate>Fri, 01 Jun 2018 21:21:48 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-number-of-CPU-cores-for-cluster-over-time/m-p/426889#M122295</guid>
      <dc:creator>somesoni2</dc:creator>
      <dc:date>2018-06-01T21:21:48Z</dc:date>
    </item>
    <item>
      <title>Re: How to calculate the number of CPU cores for cluster, over time?</title>
      <link>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-number-of-CPU-cores-for-cluster-over-time/m-p/426890#M122296</link>
      <description>&lt;P&gt;Yep, the second worked:&lt;/P&gt;

&lt;PRE&gt;&lt;CODE&gt;index="vmware-inv" sourcetype="vmware:inv:vm" eventtype=vmware_inventory power_state=poweredOn
  | bucket span=1d _time
  | stats count by vm_name,cluster_name,cpu_cores,_time
  | timechart span=1d sum(cpu_cores) by cluster_name
&lt;/CODE&gt;&lt;/PRE&gt;

&lt;P&gt;Ty sir!&lt;/P&gt;</description>
      <pubDate>Fri, 01 Jun 2018 21:29:58 GMT</pubDate>
      <guid>https://community.splunk.com/t5/Splunk-Search/How-to-calculate-the-number-of-CPU-cores-for-cluster-over-time/m-p/426890#M122296</guid>
      <dc:creator>johnansett</dc:creator>
      <dc:date>2018-06-01T21:29:58Z</dc:date>
    </item>
  </channel>
</rss>

