Get-AzMetricsBatch
Listet die Metrikwerte für mehrere Ressourcen auf.
Syntax
Get-AzMetricsBatch
-Endpoint <String>
[-SubscriptionId <String[]>]
-Name <System.Collections.Generic.List`1[System.String]>
-Namespace <String>
[-Aggregation <String>]
[-EndTime <String>]
[-Filter <String>]
[-Interval <String>]
[-Orderby <String>]
[-Rollupby <String>]
[-StartTime <String>]
[-Top <Int32>]
[-ResourceId <String[]>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Get-AzMetricsBatch
-Endpoint <String>
-InputObject <IMetricIdentity>
-Name <System.Collections.Generic.List`1[System.String]>
-Namespace <String>
[-Aggregation <String>]
[-EndTime <String>]
[-Filter <String>]
[-Interval <String>]
[-Orderby <String>]
[-Rollupby <String>]
[-StartTime <String>]
[-Top <Int32>]
[-ResourceId <String[]>]
[-DefaultProfile <PSObject>]
[-WhatIf]
[-Confirm]
[<CommonParameters>]
Beschreibung
Listet die Metrikwerte für mehrere Ressourcen auf.
Beispiele
Beispiel 1: Abrufen von Eingangs- und Ausgang des Speicherkontos
$endpoint = 'https://eastus.metrics.monitor.azure.com'
$start = "2023-12-06T07:00:00.000Z"
$end = "2023-12-06T08:00:00.000Z"
Get-AzMetricsBatch -Endpoint $endpoint -Name 'ingress','egress' -Namespace "Microsoft.Storage/storageAccounts" -EndTime $end -StartTime $start -ResourceId /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/joyer-monitor/providers/Microsoft.Storage/storageAccounts/psmetric01
Endtime : 2023-12-06T08:00:00Z
Interval : 00:01:00a
Namespace : Microsoft.Storage/storageAccounts
Resourceid : /subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/joyer-monitor/providers/Microsoft.Storage/storageAccounts/psmetric01
Resourceregion : eastus
Starttime : 2023-12-06T07:00:00Z
Value : {{
"name": {
"value": "Ingress",
"localizedValue": "Ingress"
},
"id": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/joyer-monitor/providers/Microsoft.Storage/storageAccounts/psmetric01/providers/Microsoft.Insigh
ts/metrics/Ingress",
"type": "Microsoft.Insights/metrics",
"displayDescription": "The amount of ingress data, in bytes. This number includes ingress from an external client into Azure Storage as well as ingress within Azure.",
"errorCode": "Success",
"unit": "Bytes",
"timeseries": [
{
"metadatavalues": [ ],
"data": [
{
"timeStamp": "2023-12-06T07:00:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:01:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:02:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:03:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:04:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:05:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:06:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:07:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:08:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:09:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:10:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:11:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:12:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:13:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:14:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:15:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:16:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:17:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:18:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:19:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:20:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:21:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:22:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:23:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:24:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:25:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:26:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:27:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:28:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:29:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:30:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:31:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:32:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:33:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:34:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:35:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:36:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:37:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:38:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:39:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:40:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:41:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:42:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:43:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:44:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:45:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:46:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:47:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:48:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:49:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:50:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:51:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:52:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:53:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:54:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:55:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:56:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:57:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:58:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:59:00.0000000Z",
"total": 0
}
]
}
]
}, {
"name": {
"value": "Egress",
"localizedValue": "Egress"
},
"id": "/subscriptions/9e223dbe-3399-4e19-88eb-0975f02ac87f/resourcegroups/joyer-monitor/providers/Microsoft.Storage/storageAccounts/psmetric01/providers/Microsoft.Insigh
ts/metrics/Egress",
"type": "Microsoft.Insights/metrics",
"displayDescription": "The amount of egress data. This number includes egress to external client from Azure Storage as well as egress within Azure. As a result, this
number does not reflect billable egress.",
"errorCode": "Success",
"unit": "Bytes",
"timeseries": [
{
"metadatavalues": [ ],
"data": [
{
"timeStamp": "2023-12-06T07:00:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:01:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:02:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:03:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:04:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:05:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:06:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:07:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:08:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:09:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:10:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:11:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:12:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:13:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:14:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:15:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:16:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:17:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:18:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:19:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:20:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:21:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:22:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:23:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:24:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:25:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:26:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:27:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:28:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:29:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:30:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:31:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:32:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:33:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:34:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:35:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:36:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:37:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:38:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:39:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:40:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:41:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:42:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:43:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:44:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:45:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:46:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:47:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:48:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:49:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:50:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:51:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:52:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:53:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:54:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:55:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:56:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:57:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:58:00.0000000Z",
"total": 0
},
{
"timeStamp": "2023-12-06T07:59:00.0000000Z",
"total": 0
}
]
}
]
}}
Dieser Befehl listet die Metrikwerte für angegebene Ressourcen auf.
PARAMETERS
-Aggregation
Die Liste der aggregationstypen (kommagetrennt), die abgerufen werden sollen. Beispiele: Mittelwert, Minimum, Maximalwert
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-DefaultProfile
Der Parameter DefaultProfile ist nicht funktionsfähig. Verwenden Sie den Parameter "SubscriptionId", wenn sie verfügbar ist, wenn Sie das Cmdlet für ein anderes Abonnement ausführen.
Type: PSObject
Parameter Sets: (All)
Aliases: AzureRMContext, AzureCredential
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Endpunkt
Der zu verwendende regionale Endpunkt, z. B https://eastus.metrics.monitor.azure.com
. .
Die Region sollte mit der Region der angeforderten Ressourcen übereinstimmen.
Für globale Ressourcen sollte die Region "global" sein.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Endtime
Die Endzeit der Abfrage. Es handelt sich um eine Zeichenfolge im Format "yyyy-MM-ddTHH:mm:ss.fffZ".
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Filter
Der Filter wird verwendet, um den Satz zurückgegebener Metrikdaten zu reduzieren. Beispiel: Die Metrik enthält die Metadaten A, B und C.
- Gibt alle Zeitreihen von C zurück, wobei A = a1 und B = b1 oder b2 filter=A eq 'a1' und B eq 'b1' oder B eq 'b2' und C eq '*'
- Ungültige Variante: filter=A eq 'a1' and B eq 'b1' and C eq '*' or B = 'b2' This is invalid because the logical or operator cannot separate two different metadata names.
- Gibt alle Zeitreihen zurück, wobei A = a1, B = b1 und C = c1: filter=A eq 'a1' und B eq 'b1' und C eq 'c1'
- Gibt alle Zeitreihen zurück, wobei A = a1 filter=A eq 'a1' und B eq '' und C eq '' zurück.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-InputObject
Identity Parameter To construct, see NOTES section for INPUTOBJECT properties and create a hash table.
Type: IMetricIdentity
Parameter Sets: BatchViaIdentityExpanded
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False
-Intervall
Das Intervall (d. h. Zeitgran) der Abfrage im ISO 8601-Dauerformat. Standardwert ist PT1M. Sonderfall für den Wert "FULL", der einen einzelnen Datenpunkt für die gesamte angeforderte Zeitspanne zurückgibt. Beispiele: PT15M, PT1H, P1D, FULL
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Name
Die Namen der abzurufenden Metriken (kommagetrennt).
Type: System.Collections.Generic.List`1[System.String]
Parameter Sets: (All)
Aliases: MetricName
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Namespace
Metrischer Namespace, der die angeforderten Metriknamen enthält.
Type: String
Parameter Sets: (All)
Aliases: MetricNamespace
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Orderby
Die Aggregation, die zum Sortieren von Ergebnissen und zur Richtung der Sortierung verwendet werden soll. Es kann nur eine Bestellung angegeben werden. Beispiele: Summe asc
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-ResourceId
Die Liste der Ressourcen-IDs zum Abfragen von Metriken.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Rollupby
Bemaßungsname(n) zum Rollup der Ergebnisse nach. Wenn Sie beispielsweise nur Metrikwerte mit einem Filter wie "City eq Seattle oder City eq Tacoma" anzeigen möchten, aber keine separaten Werte für jede Stadt sehen möchten, können Sie "RollUpBy=City" angeben, um die Ergebnisse für Seattle und Tacoma in einer Zeitserie anzuzeigen.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Starttime
Die Startzeit der Abfrage. Es handelt sich um eine Zeichenfolge im Format "yyyy-MM-ddTHH:mm:ss.fffZ". Wenn Sie den Endtime-Parameter angegeben haben, ist dieser Parameter erforderlich. Wenn nur Startzeit angegeben ist, wird endtime standardmäßig auf die aktuelle Uhrzeit festgelegt. Wenn kein Zeitintervall angegeben ist, ist der Standardwert 1 Stunde.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-SubscriptionId
Der Abonnementbezeichner für die Ressourcen in diesem Batch.
Type: String[]
Parameter Sets: BatchExpanded
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-Top
Die maximale Anzahl von Datensätzen, die pro Ressourcen-ID in der Anforderung abgerufen werden sollen. Nur gültig, wenn filter angegeben ist. Der Standardwert ist 10.
Type: Int32
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: 0
Accept pipeline input: False
Accept wildcard characters: False
-Confirm
Hiermit werden Sie vor der Ausführung des Cmdlets zur Bestätigung aufgefordert.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
-WhatIf
Zeigt, was geschieht, wenn das Cmdlet ausgeführt wird. Das Cmdlet wird nicht ausgeführt.
Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False
CommonParameters
Dieses Cmdlet unterstützt diese gängigen Parameter: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction und -WarningVariable. Weitere Informationen findest du unter about_CommonParameters.
EINGABEN
Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricIdentity
AUSGABEN
Microsoft.Azure.PowerShell.Cmdlets.Metric.Models.IMetricResultsResponse
HINWEISE
KOMPLEXE PARAMETEREIGENSCHAFTEN
Um die unten beschriebenen Parameter zu erstellen, erstellen Sie eine Hashtabelle mit den entsprechenden Eigenschaften. Informationen zu Hashtabellen finden Sie unter "Get-Help about_Hash_Tables".
INPUTOBJECT <IMetricIdentity>: Identity Parameter [Id <String>]: Ressourcenidentitätspfad [SubscriptionId <String>]: Der Abonnementbezeichner für die Ressourcen in diesem Batch.
VERWANDTE LINKS
https://learn.microsoft.com/powershell/module/az.monitor/get-azmetricsbatch
Azure PowerShell
Feedback
https://aka.ms/ContentUserFeedback.
Bald verfügbar: Im Laufe des Jahres 2024 werden wir GitHub-Issues stufenweise als Feedbackmechanismus für Inhalte abbauen und durch ein neues Feedbacksystem ersetzen. Weitere Informationen finden Sie unterFeedback senden und anzeigen für