Ugh! I hate having to ask for query help, but I'm close.. but not close enough. Basically, I have two sets of data. I want to compare information in a field from set 'A', to the cumulative set of records in set 'B'. So, my set 'A' data will look something like this:
[EDITED to include real data]
In my environment, I run a visualization cluster. One area I want to get visibility into is overallocation of CPUs. Using splunk, I am recording a lot of machine information from the Hypervisors.
For instance a data set for a hypervisor looks like this:
Timestamp=1334260801
Host=S-HYPERV2
Source=ComputerSystem
Name=S-HYPERV2
NumbOfProcs=16
In this data set, I am interested in NumbOfProcs.
In the second data set, I am going to count how my virtual processors are allocated, and compare that to the total above. That data set looks like this:
(record 1)
Timestamp=1334260801
Host=S-HYPERV2
Source=HypervGuestCPU
HCPU="v-sqldb:Hv VP 0"
PercGuestTime=17
PercHostTime=1
PercTotalTime=18
(record 2)
Timestamp=1334260801
Host=S-HYPERV2
Source=HypervGuestCPU
HCPU="v-sqldb:Hv VP 1"
PercGuestTime=2
PercHostTime=0
PercTotalTime=2
For each record, it's a unique vcpu. So, I have done this to get pretty close:
Host="*HYPERV*" AND sourcetype="HypervGuestCPU" AND NOT HCPU="_Total" |dedup HCPU | chart count(HCPU) by host | appendcols [search Host="*HYPERV*" AND sourcetype="ComputerSystem" | dedup Host | eval NumbofCPUs=(NumbOfProcs) | chart sum(NumbofCPUs) by Host ]
Issues I have are, that I don't like the output. I also am just dumping out out,I would prefer to be able to compare the numbers (total and the count).
Additionally, if there are no vcpus being used, then I have a weird looking table.
Ultimately, I attempting to get the output of :
Server VCPUs Physical
S-HYPERV2 2 16
And it would be fantastic if I could actually compare them for alerting. I'm afraid this is a little over my query foo.
This doesn't have the Total number in it, but this another method I was using to build the data set:
Host="*HYPERV*" AND sourcetype="ComputerSystem" OR sourcetype="HypervGuestCPU" AND NOT HCPU="_Total" | dedup HCPU |eventstats count(HCPU) as VCPU by Host | dedup Host| table Host, VCPU
But this is just Host by VCPU, in a table.
... View more