Send-LMLogMessage
Syntax
Section titled “Syntax”SingleMessage
Section titled “SingleMessage”Send-LMLogMessage -Message <String> [-Timestamp <String>] -resourceMapping <Hashtable> [-Metadata <Hashtable>] [-ProgressAction <ActionPreference>] [<CommonParameters>]MessageList
Section titled “MessageList”Send-LMLogMessage -MessageArray <Object> [-ProgressAction <ActionPreference>] [<CommonParameters>]Description
Section titled “Description”The Send-LMLogMessage function sends log messages to LogicMonitor for logging and monitoring purposes. It supports sending a single message or an array of messages.
Examples
Section titled “Examples”Example 1
Section titled “Example 1”Send-LMLogMessage -Message "This is a test log message" -resourceMapping @{ 'system.deviceId' = '12345' } -Metadata @{ 'key1' = 'value1' }Sends a single log message with the specified message, resource mapping, and metadata.Example 2
Section titled “Example 2”Send-LMLogMessage -MessageArray $MessageObjectsArraySends an array of log message objects.Parameters
Section titled “Parameters”-Message
Section titled “-Message”Specifies the log message to send. This parameter is mandatory when using the ‘SingleMessage’ parameter set.
Type: StringParameter Sets: SingleMessageAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Timestamp
Section titled “-Timestamp”Specifies the timestamp for the log message. If not provided, the current UTC timestamp will be used. This parameter is mandatory when using the ‘SingleMessage’ parameter set.
Type: StringParameter Sets: SingleMessageAliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-resourceMapping
Section titled “-resourceMapping”Specifies the resource mapping for the log message. This parameter is mandatory when using the ‘SingleMessage’ parameter set.
Type: HashtableParameter Sets: SingleMessageAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-Metadata
Section titled “-Metadata”Specifies additional metadata to include with the log message. This parameter is optional when using the ‘SingleMessage’ parameter set.
Type: HashtableParameter Sets: SingleMessageAliases:
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-MessageArray
Section titled “-MessageArray”Specifies an array of log messages to send. This parameter is mandatory when using the ‘MessageList’ parameter set.
Type: ObjectParameter Sets: MessageListAliases:
Required: TruePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: False-ProgressAction
Section titled “-ProgressAction”Fill ProgressAction Description
Type: ActionPreferenceParameter Sets: (All)Aliases: proga
Required: FalsePosition: NamedDefault value: NoneAccept pipeline input: FalseAccept wildcard characters: FalseCommonParameters
Section titled “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.