Splunk Search

How to count for each host

incoghnito_1
Engager

Hi every one 
I have some difficulty to count my consumedHostUnits 
I have this commande : 

index="dynatrace_hp" | search endpoint="infrastructure/hosts" | stats distinct_count(discoveredName) count(consumedHostUnits) by "managementZones{}.name" | search "managementZones{}.name"="[Env]*"

But the results d'ont returne the good information 

( i would like to have the total consumedhostUnis for all the host in a managementZone)

Thx for you Help ! 

Labels (1)
0 Karma

incoghnito_1
Engager

Thx for help
Data is like this several time 

{
 
   agentVersion: { 
   }

   bitness: 64bit
   consumedHostUnits: 2
   cpuCores: 4
   customizedName: Incoghnito
   discoveredName: Incoghnito
   displayName: Incoghnito
   endpoint: infrastructure/hosts
   entityId: Incoghnito
   esxiHostName: Incoghnito
   firstSeenTimestamp: 1628511931970
   fromRelationships: { 
   }

   hostGroup: { 
   }

   hypervisorType: VMWARE
   ipAddresses: [ 
   ]

   lastSeenTimestamp: 1638953598701
   logicalCpuCores: 4
   managementZones: [ 
   ]

   monitoringMode: FULL_STACK
   networkZoneId: default
   oneAgentCustomHostName:
   osArchitecture: X86
   osType: LINUX
   osVersion:Incoghnito
   tags: [ 
   ]

   timestamp: 1638953598
   toRelationships: { 
   }

   userLevel: NON_SUPERUSER
   vmwareName:Incoghnito

}

0 Karma

isoutamo
SplunkTrust
SplunkTrust
Hi
can you post example data, so we can help you?
r. Ismo
0 Karma
Got questions? Get answers!

Join the Splunk Community Slack to learn, troubleshoot, and make connections with fellow Splunk practitioners in real time!

Meet up IRL or virtually!

Join Splunk User Groups to connect and learn in-person by region or remotely by topic or industry.

Get Updates on the Splunk Community!

Announcing Modern Navigation: A New Era of Splunk User Experience

We are excited to introduce the Modern Navigation feature in the Splunk Platform, available to both cloud and ...

Kubernetes Alerts That Work Out of the Box with AutoDetect detectors in Splunk ...

A deployment rolls out slowly, one pod sits not ready for a few minutes, and whoever is on call gets an alert ...

Observability at Your Fingertips Directly From Splunk Platform—for Free

At .conf, we announced our roadmap to bring observability foundations to Splunk Platform. Bringing metrics and ...