Repository navigation
ConvertTo Metric
Converts the specified properties of an object to a metric object, which can then be easily transmitted to Influx.
ConvertTo-Metric [[-InputObject] <Object>] -Measure <String> -MetricProperty <String[]>
[-TagProperty <String[]>] [-TimeProperty <String>] [-Tags <Hashtable>] [-ProgressAction <ActionPreference>]
[<CommonParameters>]
Use to convert any PowerShell object in to a Metric object with specified Measure name, Metrics and Tags. The metrics are one or more named properties of the object. The (optional) Tags can be one or more named properties of the object and/or a provided hashtable of custom tags.
Get-Process | ConvertTo-Metric -Measure Processes -MetricProperty CPU -TagProperty Name,ID -Tags @{Host = $Env:ComputerName}
This command will convert the specified object properties in to metrics and tags for a measure called 'Processes'.
The object that you want to convert to a metric object. Can be provided via the pipeline.
Type: Object
Parameter Sets: (All)
Aliases:
Required: False
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: FalseThe name of the measure to be updated or created.
Type: String
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOne or more strings which match property names of the Input Object that you want to convert to Metrics.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOptional: One or more strings which match property names of the Input Object, that you want to use as Tag data.
Type: String[]
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOptional: A string that matches a property name of the Input Object, that you want to use as the TimeStamp data.
Type: String
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseOptional: A hashtable of custom tag names and values.
Type: Hashtable
Parameter Sets: (All)
Aliases:
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False{{Fill ProgressAction Description}}
Type: ActionPreference
Parameter Sets: (All)
Aliases: proga
Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: FalseThis cmdlet supports the common parameters: -Debug, -ErrorAction, -ErrorVariable, -InformationAction, -InformationVariable, -OutVariable, -OutBuffer, -PipelineVariable, -Verbose, -WarningAction, and -WarningVariable. For more information, see about_CommonParameters (http://go.microsoft.com/fwlink/?LinkID=113216).