Skip to content

ConvertTo InfluxLineString

AzureDevOps edited this page Sep 25, 2026 · 1 revision

ConvertTo-InfluxLineString

SYNOPSIS

Converts metric objects or data to the Influx line format.

SYNTAX

MetricObject

ConvertTo-InfluxLineString [-InputObject] <PSObject[]> [-ExcludeEmptyMetric]
 [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

Measure

ConvertTo-InfluxLineString [-Measure] <String> [-Tags <Hashtable>] -Metrics <Hashtable> [-TimeStamp <DateTime>]
 [-ExcludeEmptyMetric] [-ProgressAction <ActionPreference>] [-WhatIf] [-Confirm] [<CommonParameters>]

DESCRIPTION

Use to convert some metrics in to the Influx line format for later consumption in to Influx such as via the Telegraf exec plugin.

EXAMPLES

EXAMPLE 1

ConvertTo-InfluxLineString -Measure WebServer -Tags @{Server='Host01'} -Metrics @{CPU=100; Memory=50}

Description

This command will output the provided tag and metric data for a measure called 'WebServer' as strings in the Influx line format.

PARAMETERS

-InputObject

A metric object (generated by one of the Get-*Metric cmdlets from this module) which can be provided as pipeline input.

Type: PSObject[]
Parameter Sets: MetricObject
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: True (ByValue)
Accept wildcard characters: False

-Measure

The name of the measure to be updated or created.

Type: String
Parameter Sets: Measure
Aliases:

Required: True
Position: 1
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Tags

A hashtable of tag names and values.

Type: Hashtable
Parameter Sets: Measure
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Metrics

A hashtable of metric names and values.

Type: Hashtable
Parameter Sets: Measure
Aliases:

Required: True
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-TimeStamp

Specify the exact date and time for the measure data point. If not specified the current date and time is used.

Type: DateTime
Parameter Sets: Measure
Aliases:

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ExcludeEmptyMetric

Switch: Use to exclude null or empty metric values from being processed. Useful where a metric is initially created as an integer but then an empty or null instance of that metric would attempt to be sent as an empty string, resulting in a datatype conflict.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

Required: False
Position: Named
Default value: False
Accept pipeline input: False
Accept wildcard characters: False

-WhatIf

Shows what would happen if the cmdlet runs. The cmdlet is not run.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: wi

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-Confirm

Prompts you for confirmation before running the cmdlet.

Type: SwitchParameter
Parameter Sets: (All)
Aliases: cf

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

-ProgressAction

{{Fill ProgressAction Description}}

Type: ActionPreference
Parameter Sets: (All)
Aliases: proga

Required: False
Position: Named
Default value: None
Accept pipeline input: False
Accept wildcard characters: False

CommonParameters

This 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).

INPUTS

OUTPUTS

NOTES

RELATED LINKS

Clone this wiki locally