Skip to content

New-PodeLogAzureMethod

SYNOPSIS

Creates a new Azure Log Analytics Log Method.

SYNTAX

Workspace

New-PodeLogAzureMethod [-Id <String>] -WorkspaceId <String> -SharedKey <String> -LogType <String>
 [-Source <String>] [-BatchInfo <Hashtable>] [-SkipCertificateCheck] [-ProgressAction <ActionPreference>]
 [<CommonParameters>]

DataCollection

New-PodeLogAzureMethod [-Id <String>] -Endpoint <String> -ImmutableId <String> -StreamName <String>
 -ClientId <String> -ClientSecret <String> -TenantId <String> [-Source <String>] [-BatchInfo <Hashtable>]
 [-SkipCertificateCheck] [-ProgressAction <ActionPreference>] [<CommonParameters>]

DESCRIPTION

Creates a new Azure Log Analytics Log Method for outputting log items to an Azure Log Analytics workspace. The Azure Log Method created will either use the legacy Workspace method, or the new Data Collection logic.

EXAMPLES

EXAMPLE 1

' -SharedKey '<shared_key>' -LogType 'MyCustomLog'

EXAMPLE 2

$batchInfo = New-PodeLogBatchInfo -Size 10 -Timeout 10
$methodId = New-PodeLogAzureMethod -WorkspaceId '<workspace_id>' -SharedKey '<shared_key>' -LogType 'MyCustomLog' -BatchInfo $batchInfo -Source 'my_source'

PARAMETERS

-BatchInfo

An optional hashtable containing batch configuration for writing log items in bulk. Should be created using New-PodeLogBatchInfo.

Type: Hashtable
Parameter Sets: (All)
Aliases:

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

-ClientId

The Client ID from registering a new app.

Type: String
Parameter Sets: DataCollection
Aliases:

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

-ClientSecret

The Client Secret from registering a new app.

Type: String
Parameter Sets: DataCollection
Aliases:

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

-Endpoint

The Data Collection Endpoint used for ingestion into Azure Monitor/Azure Log Analytics.

Type: String
Parameter Sets: DataCollection
Aliases:

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

-Id

An optional ID to assign to the Log Method. If not supplied, a random ID will be generated.

Type: String
Parameter Sets: (All)
Aliases:

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

-ImmutableId

The Data Collection Rule Immutable ID.

Type: String
Parameter Sets: DataCollection
Aliases:

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

-LogType

The Log Type to use for the log items in Azure Log Analytics, used for the Log-Type header.

Type: String
Parameter Sets: Workspace
Aliases:

Required: True
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

-SharedKey

The Shared Key of the Azure Log Analytics workspace.

Type: String
Parameter Sets: Workspace
Aliases:

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

-SkipCertificateCheck

If supplied, the API request will skip certificate validation checks.

Type: SwitchParameter
Parameter Sets: (All)
Aliases:

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

-Source

An optional source to include with the log items. (Default: the server's AppName)

Type: String
Parameter Sets: (All)
Aliases:

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

-StreamName

The Stream Name in the Data Collection Rule that should handle the logs.

Type: String
Parameter Sets: DataCollection
Aliases:

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

-TenantId

The Directory/Tenant ID from registering a new app.

Type: String
Parameter Sets: DataCollection
Aliases:

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

-WorkspaceId

The Workspace ID of the Azure Log Analytics workspace.

Type: String
Parameter Sets: Workspace
Aliases:

Required: True
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.

INPUTS

OUTPUTS

System.String

NOTES