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: { 
   }

   bitness64bit
   consumedHostUnits2
   cpuCores4
   customizedNameIncoghnito
   discoveredName: Incoghnito
   displayName: Incoghnito
   endpointinfrastructure/hosts
   entityIdIncoghnito
   esxiHostNameIncoghnito
   firstSeenTimestamp1628511931970
   fromRelationships: { 
   }

   hostGroup: { 
   }

   hypervisorTypeVMWARE
   ipAddresses: [ 
   ]

   lastSeenTimestamp1638953598701
   logicalCpuCores4
   managementZones: [ 
   ]

   monitoringModeFULL_STACK
   networkZoneIddefault
   oneAgentCustomHostName:
   osArchitectureX86
   osTypeLINUX
   osVersion:Incoghnito
   tags: [ 
   ]

   timestamp1638953598
   toRelationships: { 
   }

   userLevelNON_SUPERUSER
   vmwareName:Incoghnito

}

0 Karma

isoutamo
SplunkTrust
SplunkTrust
Hi
can you post example data, so we can help you?
r. Ismo
0 Karma
Get Updates on the Splunk Community!

Splunk MCP & Agentic AI: Machine Data Without Limits

  Discover how the Splunk Model Context Protocol (MCP) Server can revolutionize the way your organization ...

Finding Based Detections General Availability

Overview  We’ve come a long way, folks, but here in Enterprise Security 8.4 I’m happy to announce Finding ...

Get Your Hands Dirty (and Your Shoes Comfy): The Splunk Experience

Hands-On Learning and Technical Seminars  Sometimes, you just need to see the code. For those looking for a ...