azure.monitoring.ScheduledQueryRulesLog

Manages a LogToMetricAction Scheduled Query Rules resource within Azure Monitor.

Example Usage

using System.Collections.Generic;
using Pulumi;
using Azure = Pulumi.Azure;

return await Deployment.RunAsync(() => 
{
    var exampleResourceGroup = new Azure.Core.ResourceGroup("exampleResourceGroup", new()
    {
        Location = "West Europe",
    });

    var exampleAnalyticsWorkspace = new Azure.OperationalInsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        Sku = "PerGB2018",
        RetentionInDays = 30,
    });

    var exampleActionGroup = new Azure.Monitoring.ActionGroup("exampleActionGroup", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        ShortName = "exampleact",
        WebhookReceivers = new[]
        {
            new Azure.Monitoring.Inputs.ActionGroupWebhookReceiverArgs
            {
                Name = "callmyapi",
                ServiceUri = "http://example.com/alert",
            },
        },
    });

    // Example: Creates alert using the new Scheduled Query Rules metric
    var exampleMetricAlert = new Azure.Monitoring.MetricAlert("exampleMetricAlert", new()
    {
        ResourceGroupName = exampleResourceGroup.Name,
        Scopes = new[]
        {
            exampleAnalyticsWorkspace.Id,
        },
        Description = "Action will be triggered when Average_% Idle Time metric is less than 10.",
        Frequency = "PT1M",
        WindowSize = "PT5M",
        Criterias = new[]
        {
            new Azure.Monitoring.Inputs.MetricAlertCriteriaArgs
            {
                MetricNamespace = "Microsoft.OperationalInsights/workspaces",
                MetricName = "UsedCapacity",
                Aggregation = "Average",
                Operator = "LessThan",
                Threshold = 10,
            },
        },
        Actions = new[]
        {
            new Azure.Monitoring.Inputs.MetricAlertActionArgs
            {
                ActionGroupId = exampleActionGroup.Id,
            },
        },
    });

    // Example: LogToMetric Action for the named Computer
    var exampleScheduledQueryRulesLog = new Azure.Monitoring.ScheduledQueryRulesLog("exampleScheduledQueryRulesLog", new()
    {
        Location = exampleResourceGroup.Location,
        ResourceGroupName = exampleResourceGroup.Name,
        Criteria = new Azure.Monitoring.Inputs.ScheduledQueryRulesLogCriteriaArgs
        {
            MetricName = "Average_% Idle Time",
            Dimensions = new[]
            {
                new Azure.Monitoring.Inputs.ScheduledQueryRulesLogCriteriaDimensionArgs
                {
                    Name = "Computer",
                    Operator = "Include",
                    Values = new[]
                    {
                        "targetVM",
                    },
                },
            },
        },
        DataSourceId = exampleAnalyticsWorkspace.Id,
        Description = "Scheduled query rule LogToMetric example",
        Enabled = true,
        Tags = 
        {
            { "foo", "bar" },
        },
    });

});
package main

import (
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/core"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/monitoring"
	"github.com/pulumi/pulumi-azure/sdk/v5/go/azure/operationalinsights"
	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)

func main() {
	pulumi.Run(func(ctx *pulumi.Context) error {
		exampleResourceGroup, err := core.NewResourceGroup(ctx, "exampleResourceGroup", &core.ResourceGroupArgs{
			Location: pulumi.String("West Europe"),
		})
		if err != nil {
			return err
		}
		exampleAnalyticsWorkspace, err := operationalinsights.NewAnalyticsWorkspace(ctx, "exampleAnalyticsWorkspace", &operationalinsights.AnalyticsWorkspaceArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			Sku:               pulumi.String("PerGB2018"),
			RetentionInDays:   pulumi.Int(30),
		})
		if err != nil {
			return err
		}
		exampleActionGroup, err := monitoring.NewActionGroup(ctx, "exampleActionGroup", &monitoring.ActionGroupArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			ShortName:         pulumi.String("exampleact"),
			WebhookReceivers: monitoring.ActionGroupWebhookReceiverArray{
				&monitoring.ActionGroupWebhookReceiverArgs{
					Name:       pulumi.String("callmyapi"),
					ServiceUri: pulumi.String("http://example.com/alert"),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = monitoring.NewMetricAlert(ctx, "exampleMetricAlert", &monitoring.MetricAlertArgs{
			ResourceGroupName: exampleResourceGroup.Name,
			Scopes: pulumi.StringArray{
				exampleAnalyticsWorkspace.ID(),
			},
			Description: pulumi.String("Action will be triggered when Average_% Idle Time metric is less than 10."),
			Frequency:   pulumi.String("PT1M"),
			WindowSize:  pulumi.String("PT5M"),
			Criterias: monitoring.MetricAlertCriteriaArray{
				&monitoring.MetricAlertCriteriaArgs{
					MetricNamespace: pulumi.String("Microsoft.OperationalInsights/workspaces"),
					MetricName:      pulumi.String("UsedCapacity"),
					Aggregation:     pulumi.String("Average"),
					Operator:        pulumi.String("LessThan"),
					Threshold:       pulumi.Float64(10),
				},
			},
			Actions: monitoring.MetricAlertActionArray{
				&monitoring.MetricAlertActionArgs{
					ActionGroupId: exampleActionGroup.ID(),
				},
			},
		})
		if err != nil {
			return err
		}
		_, err = monitoring.NewScheduledQueryRulesLog(ctx, "exampleScheduledQueryRulesLog", &monitoring.ScheduledQueryRulesLogArgs{
			Location:          exampleResourceGroup.Location,
			ResourceGroupName: exampleResourceGroup.Name,
			Criteria: &monitoring.ScheduledQueryRulesLogCriteriaArgs{
				MetricName: pulumi.String("Average_% Idle Time"),
				Dimensions: monitoring.ScheduledQueryRulesLogCriteriaDimensionArray{
					&monitoring.ScheduledQueryRulesLogCriteriaDimensionArgs{
						Name:     pulumi.String("Computer"),
						Operator: pulumi.String("Include"),
						Values: pulumi.StringArray{
							pulumi.String("targetVM"),
						},
					},
				},
			},
			DataSourceId: exampleAnalyticsWorkspace.ID(),
			Description:  pulumi.String("Scheduled query rule LogToMetric example"),
			Enabled:      pulumi.Bool(true),
			Tags: pulumi.StringMap{
				"foo": pulumi.String("bar"),
			},
		})
		if err != nil {
			return err
		}
		return nil
	})
}
package generated_program;

import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.azure.core.ResourceGroup;
import com.pulumi.azure.core.ResourceGroupArgs;
import com.pulumi.azure.operationalinsights.AnalyticsWorkspace;
import com.pulumi.azure.operationalinsights.AnalyticsWorkspaceArgs;
import com.pulumi.azure.monitoring.ActionGroup;
import com.pulumi.azure.monitoring.ActionGroupArgs;
import com.pulumi.azure.monitoring.inputs.ActionGroupWebhookReceiverArgs;
import com.pulumi.azure.monitoring.MetricAlert;
import com.pulumi.azure.monitoring.MetricAlertArgs;
import com.pulumi.azure.monitoring.inputs.MetricAlertCriteriaArgs;
import com.pulumi.azure.monitoring.inputs.MetricAlertActionArgs;
import com.pulumi.azure.monitoring.ScheduledQueryRulesLog;
import com.pulumi.azure.monitoring.ScheduledQueryRulesLogArgs;
import com.pulumi.azure.monitoring.inputs.ScheduledQueryRulesLogCriteriaArgs;
import java.util.List;
import java.util.ArrayList;
import java.util.Map;
import java.io.File;
import java.nio.file.Files;
import java.nio.file.Paths;

public class App {
    public static void main(String[] args) {
        Pulumi.run(App::stack);
    }

    public static void stack(Context ctx) {
        var exampleResourceGroup = new ResourceGroup("exampleResourceGroup", ResourceGroupArgs.builder()        
            .location("West Europe")
            .build());

        var exampleAnalyticsWorkspace = new AnalyticsWorkspace("exampleAnalyticsWorkspace", AnalyticsWorkspaceArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .sku("PerGB2018")
            .retentionInDays(30)
            .build());

        var exampleActionGroup = new ActionGroup("exampleActionGroup", ActionGroupArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .shortName("exampleact")
            .webhookReceivers(ActionGroupWebhookReceiverArgs.builder()
                .name("callmyapi")
                .serviceUri("http://example.com/alert")
                .build())
            .build());

        var exampleMetricAlert = new MetricAlert("exampleMetricAlert", MetricAlertArgs.builder()        
            .resourceGroupName(exampleResourceGroup.name())
            .scopes(exampleAnalyticsWorkspace.id())
            .description("Action will be triggered when Average_% Idle Time metric is less than 10.")
            .frequency("PT1M")
            .windowSize("PT5M")
            .criterias(MetricAlertCriteriaArgs.builder()
                .metricNamespace("Microsoft.OperationalInsights/workspaces")
                .metricName("UsedCapacity")
                .aggregation("Average")
                .operator("LessThan")
                .threshold(10)
                .build())
            .actions(MetricAlertActionArgs.builder()
                .actionGroupId(exampleActionGroup.id())
                .build())
            .build());

        var exampleScheduledQueryRulesLog = new ScheduledQueryRulesLog("exampleScheduledQueryRulesLog", ScheduledQueryRulesLogArgs.builder()        
            .location(exampleResourceGroup.location())
            .resourceGroupName(exampleResourceGroup.name())
            .criteria(ScheduledQueryRulesLogCriteriaArgs.builder()
                .metricName("Average_% Idle Time")
                .dimensions(ScheduledQueryRulesLogCriteriaDimensionArgs.builder()
                    .name("Computer")
                    .operator("Include")
                    .values("targetVM")
                    .build())
                .build())
            .dataSourceId(exampleAnalyticsWorkspace.id())
            .description("Scheduled query rule LogToMetric example")
            .enabled(true)
            .tags(Map.of("foo", "bar"))
            .build());

    }
}
import pulumi
import pulumi_azure as azure

example_resource_group = azure.core.ResourceGroup("exampleResourceGroup", location="West Europe")
example_analytics_workspace = azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    sku="PerGB2018",
    retention_in_days=30)
example_action_group = azure.monitoring.ActionGroup("exampleActionGroup",
    resource_group_name=example_resource_group.name,
    short_name="exampleact",
    webhook_receivers=[azure.monitoring.ActionGroupWebhookReceiverArgs(
        name="callmyapi",
        service_uri="http://example.com/alert",
    )])
# Example: Creates alert using the new Scheduled Query Rules metric
example_metric_alert = azure.monitoring.MetricAlert("exampleMetricAlert",
    resource_group_name=example_resource_group.name,
    scopes=[example_analytics_workspace.id],
    description="Action will be triggered when Average_% Idle Time metric is less than 10.",
    frequency="PT1M",
    window_size="PT5M",
    criterias=[azure.monitoring.MetricAlertCriteriaArgs(
        metric_namespace="Microsoft.OperationalInsights/workspaces",
        metric_name="UsedCapacity",
        aggregation="Average",
        operator="LessThan",
        threshold=10,
    )],
    actions=[azure.monitoring.MetricAlertActionArgs(
        action_group_id=example_action_group.id,
    )])
# Example: LogToMetric Action for the named Computer
example_scheduled_query_rules_log = azure.monitoring.ScheduledQueryRulesLog("exampleScheduledQueryRulesLog",
    location=example_resource_group.location,
    resource_group_name=example_resource_group.name,
    criteria=azure.monitoring.ScheduledQueryRulesLogCriteriaArgs(
        metric_name="Average_% Idle Time",
        dimensions=[azure.monitoring.ScheduledQueryRulesLogCriteriaDimensionArgs(
            name="Computer",
            operator="Include",
            values=["targetVM"],
        )],
    ),
    data_source_id=example_analytics_workspace.id,
    description="Scheduled query rule LogToMetric example",
    enabled=True,
    tags={
        "foo": "bar",
    })
import * as pulumi from "@pulumi/pulumi";
import * as azure from "@pulumi/azure";

const exampleResourceGroup = new azure.core.ResourceGroup("exampleResourceGroup", {location: "West Europe"});
const exampleAnalyticsWorkspace = new azure.operationalinsights.AnalyticsWorkspace("exampleAnalyticsWorkspace", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    sku: "PerGB2018",
    retentionInDays: 30,
});
const exampleActionGroup = new azure.monitoring.ActionGroup("exampleActionGroup", {
    resourceGroupName: exampleResourceGroup.name,
    shortName: "exampleact",
    webhookReceivers: [{
        name: "callmyapi",
        serviceUri: "http://example.com/alert",
    }],
});
// Example: Creates alert using the new Scheduled Query Rules metric
const exampleMetricAlert = new azure.monitoring.MetricAlert("exampleMetricAlert", {
    resourceGroupName: exampleResourceGroup.name,
    scopes: [exampleAnalyticsWorkspace.id],
    description: "Action will be triggered when Average_% Idle Time metric is less than 10.",
    frequency: "PT1M",
    windowSize: "PT5M",
    criterias: [{
        metricNamespace: "Microsoft.OperationalInsights/workspaces",
        metricName: "UsedCapacity",
        aggregation: "Average",
        operator: "LessThan",
        threshold: 10,
    }],
    actions: [{
        actionGroupId: exampleActionGroup.id,
    }],
});
// Example: LogToMetric Action for the named Computer
const exampleScheduledQueryRulesLog = new azure.monitoring.ScheduledQueryRulesLog("exampleScheduledQueryRulesLog", {
    location: exampleResourceGroup.location,
    resourceGroupName: exampleResourceGroup.name,
    criteria: {
        metricName: "Average_% Idle Time",
        dimensions: [{
            name: "Computer",
            operator: "Include",
            values: ["targetVM"],
        }],
    },
    dataSourceId: exampleAnalyticsWorkspace.id,
    description: "Scheduled query rule LogToMetric example",
    enabled: true,
    tags: {
        foo: "bar",
    },
});
resources:
  exampleResourceGroup:
    type: azure:core:ResourceGroup
    properties:
      location: West Europe
  exampleAnalyticsWorkspace:
    type: azure:operationalinsights:AnalyticsWorkspace
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      sku: PerGB2018
      retentionInDays: 30
  exampleActionGroup:
    type: azure:monitoring:ActionGroup
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      shortName: exampleact
      webhookReceivers:
        - name: callmyapi
          serviceUri: http://example.com/alert
  # Example: Creates alert using the new Scheduled Query Rules metric
  exampleMetricAlert:
    type: azure:monitoring:MetricAlert
    properties:
      resourceGroupName: ${exampleResourceGroup.name}
      scopes:
        - ${exampleAnalyticsWorkspace.id}
      description: Action will be triggered when Average_% Idle Time metric is less than 10.
      frequency: PT1M
      windowSize: PT5M
      criterias:
        - metricNamespace: Microsoft.OperationalInsights/workspaces
          metricName: UsedCapacity
          aggregation: Average
          operator: LessThan
          threshold: 10
      actions:
        - actionGroupId: ${exampleActionGroup.id}
  # Example: LogToMetric Action for the named Computer
  exampleScheduledQueryRulesLog:
    type: azure:monitoring:ScheduledQueryRulesLog
    properties:
      location: ${exampleResourceGroup.location}
      resourceGroupName: ${exampleResourceGroup.name}
      criteria:
        metricName: Average_% Idle Time
        dimensions:
          - name: Computer
            operator: Include
            values:
              - targetVM
      dataSourceId: ${exampleAnalyticsWorkspace.id}
      description: Scheduled query rule LogToMetric example
      enabled: true
      tags:
        foo: bar

Create ScheduledQueryRulesLog Resource

new ScheduledQueryRulesLog(name: string, args: ScheduledQueryRulesLogArgs, opts?: CustomResourceOptions);
@overload
def ScheduledQueryRulesLog(resource_name: str,
                           opts: Optional[ResourceOptions] = None,
                           authorized_resource_ids: Optional[Sequence[str]] = None,
                           criteria: Optional[ScheduledQueryRulesLogCriteriaArgs] = None,
                           data_source_id: Optional[str] = None,
                           description: Optional[str] = None,
                           enabled: Optional[bool] = None,
                           location: Optional[str] = None,
                           name: Optional[str] = None,
                           resource_group_name: Optional[str] = None,
                           tags: Optional[Mapping[str, str]] = None)
@overload
def ScheduledQueryRulesLog(resource_name: str,
                           args: ScheduledQueryRulesLogArgs,
                           opts: Optional[ResourceOptions] = None)
func NewScheduledQueryRulesLog(ctx *Context, name string, args ScheduledQueryRulesLogArgs, opts ...ResourceOption) (*ScheduledQueryRulesLog, error)
public ScheduledQueryRulesLog(string name, ScheduledQueryRulesLogArgs args, CustomResourceOptions? opts = null)
public ScheduledQueryRulesLog(String name, ScheduledQueryRulesLogArgs args)
public ScheduledQueryRulesLog(String name, ScheduledQueryRulesLogArgs args, CustomResourceOptions options)
type: azure:monitoring:ScheduledQueryRulesLog
properties: # The arguments to resource properties.
options: # Bag of options to control resource's behavior.

name string
The unique name of the resource.
args ScheduledQueryRulesLogArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
resource_name str
The unique name of the resource.
args ScheduledQueryRulesLogArgs
The arguments to resource properties.
opts ResourceOptions
Bag of options to control resource's behavior.
ctx Context
Context object for the current deployment.
name string
The unique name of the resource.
args ScheduledQueryRulesLogArgs
The arguments to resource properties.
opts ResourceOption
Bag of options to control resource's behavior.
name string
The unique name of the resource.
args ScheduledQueryRulesLogArgs
The arguments to resource properties.
opts CustomResourceOptions
Bag of options to control resource's behavior.
name String
The unique name of the resource.
args ScheduledQueryRulesLogArgs
The arguments to resource properties.
options CustomResourceOptions
Bag of options to control resource's behavior.

ScheduledQueryRulesLog Resource Properties

To learn more about resource properties and how to use them, see Inputs and Outputs in the Architecture and Concepts docs.

Inputs

The ScheduledQueryRulesLog resource accepts the following input properties:

Criteria ScheduledQueryRulesLogCriteriaArgs

A criteria block as defined below.

DataSourceId string

The resource URI over which log search query is to be run.

ResourceGroupName string

The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.

AuthorizedResourceIds List<string>

A list of IDs of Resources referred into query.

Description string

The description of the scheduled query rule.

Enabled bool

Whether this scheduled query rule is enabled. Default is true.

Location string

Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.

Name string

The name of the scheduled query rule. Changing this forces a new resource to be created.

Tags Dictionary<string, string>

A mapping of tags to assign to the resource.

Criteria ScheduledQueryRulesLogCriteriaArgs

A criteria block as defined below.

DataSourceId string

The resource URI over which log search query is to be run.

ResourceGroupName string

The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.

AuthorizedResourceIds []string

A list of IDs of Resources referred into query.

Description string

The description of the scheduled query rule.

Enabled bool

Whether this scheduled query rule is enabled. Default is true.

Location string

Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.

Name string

The name of the scheduled query rule. Changing this forces a new resource to be created.

Tags map[string]string

A mapping of tags to assign to the resource.

criteria ScheduledQueryRulesLogCriteriaArgs

A criteria block as defined below.

dataSourceId String

The resource URI over which log search query is to be run.

resourceGroupName String

The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.

authorizedResourceIds List<String>

A list of IDs of Resources referred into query.

description String

The description of the scheduled query rule.

enabled Boolean

Whether this scheduled query rule is enabled. Default is true.

location String

Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.

name String

The name of the scheduled query rule. Changing this forces a new resource to be created.

tags Map<String,String>

A mapping of tags to assign to the resource.

criteria ScheduledQueryRulesLogCriteriaArgs

A criteria block as defined below.

dataSourceId string

The resource URI over which log search query is to be run.

resourceGroupName string

The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.

authorizedResourceIds string[]

A list of IDs of Resources referred into query.

description string

The description of the scheduled query rule.

enabled boolean

Whether this scheduled query rule is enabled. Default is true.

location string

Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.

name string

The name of the scheduled query rule. Changing this forces a new resource to be created.

tags {[key: string]: string}

A mapping of tags to assign to the resource.

criteria ScheduledQueryRulesLogCriteriaArgs

A criteria block as defined below.

data_source_id str

The resource URI over which log search query is to be run.

resource_group_name str

The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.

authorized_resource_ids Sequence[str]

A list of IDs of Resources referred into query.

description str

The description of the scheduled query rule.

enabled bool

Whether this scheduled query rule is enabled. Default is true.

location str

Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.

name str

The name of the scheduled query rule. Changing this forces a new resource to be created.

tags Mapping[str, str]

A mapping of tags to assign to the resource.

criteria Property Map

A criteria block as defined below.

dataSourceId String

The resource URI over which log search query is to be run.

resourceGroupName String

The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.

authorizedResourceIds List<String>

A list of IDs of Resources referred into query.

description String

The description of the scheduled query rule.

enabled Boolean

Whether this scheduled query rule is enabled. Default is true.

location String

Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.

name String

The name of the scheduled query rule. Changing this forces a new resource to be created.

tags Map<String>

A mapping of tags to assign to the resource.

Outputs

All input properties are implicitly available as output properties. Additionally, the ScheduledQueryRulesLog resource produces the following output properties:

Id string

The provider-assigned unique ID for this managed resource.

Id string

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

id string

The provider-assigned unique ID for this managed resource.

id str

The provider-assigned unique ID for this managed resource.

id String

The provider-assigned unique ID for this managed resource.

Look up Existing ScheduledQueryRulesLog Resource

Get an existing ScheduledQueryRulesLog resource’s state with the given name, ID, and optional extra properties used to qualify the lookup.

public static get(name: string, id: Input<ID>, state?: ScheduledQueryRulesLogState, opts?: CustomResourceOptions): ScheduledQueryRulesLog
@staticmethod
def get(resource_name: str,
        id: str,
        opts: Optional[ResourceOptions] = None,
        authorized_resource_ids: Optional[Sequence[str]] = None,
        criteria: Optional[ScheduledQueryRulesLogCriteriaArgs] = None,
        data_source_id: Optional[str] = None,
        description: Optional[str] = None,
        enabled: Optional[bool] = None,
        location: Optional[str] = None,
        name: Optional[str] = None,
        resource_group_name: Optional[str] = None,
        tags: Optional[Mapping[str, str]] = None) -> ScheduledQueryRulesLog
func GetScheduledQueryRulesLog(ctx *Context, name string, id IDInput, state *ScheduledQueryRulesLogState, opts ...ResourceOption) (*ScheduledQueryRulesLog, error)
public static ScheduledQueryRulesLog Get(string name, Input<string> id, ScheduledQueryRulesLogState? state, CustomResourceOptions? opts = null)
public static ScheduledQueryRulesLog get(String name, Output<String> id, ScheduledQueryRulesLogState state, CustomResourceOptions options)
Resource lookup is not supported in YAML
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
resource_name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
name
The unique name of the resulting resource.
id
The unique provider ID of the resource to lookup.
state
Any extra arguments used during the lookup.
opts
A bag of options that control this resource's behavior.
The following state arguments are supported:
AuthorizedResourceIds List<string>

A list of IDs of Resources referred into query.

Criteria ScheduledQueryRulesLogCriteriaArgs

A criteria block as defined below.

DataSourceId string

The resource URI over which log search query is to be run.

Description string

The description of the scheduled query rule.

Enabled bool

Whether this scheduled query rule is enabled. Default is true.

Location string

Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.

Name string

The name of the scheduled query rule. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.

Tags Dictionary<string, string>

A mapping of tags to assign to the resource.

AuthorizedResourceIds []string

A list of IDs of Resources referred into query.

Criteria ScheduledQueryRulesLogCriteriaArgs

A criteria block as defined below.

DataSourceId string

The resource URI over which log search query is to be run.

Description string

The description of the scheduled query rule.

Enabled bool

Whether this scheduled query rule is enabled. Default is true.

Location string

Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.

Name string

The name of the scheduled query rule. Changing this forces a new resource to be created.

ResourceGroupName string

The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.

Tags map[string]string

A mapping of tags to assign to the resource.

authorizedResourceIds List<String>

A list of IDs of Resources referred into query.

criteria ScheduledQueryRulesLogCriteriaArgs

A criteria block as defined below.

dataSourceId String

The resource URI over which log search query is to be run.

description String

The description of the scheduled query rule.

enabled Boolean

Whether this scheduled query rule is enabled. Default is true.

location String

Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.

name String

The name of the scheduled query rule. Changing this forces a new resource to be created.

resourceGroupName String

The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.

tags Map<String,String>

A mapping of tags to assign to the resource.

authorizedResourceIds string[]

A list of IDs of Resources referred into query.

criteria ScheduledQueryRulesLogCriteriaArgs

A criteria block as defined below.

dataSourceId string

The resource URI over which log search query is to be run.

description string

The description of the scheduled query rule.

enabled boolean

Whether this scheduled query rule is enabled. Default is true.

location string

Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.

name string

The name of the scheduled query rule. Changing this forces a new resource to be created.

resourceGroupName string

The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.

tags {[key: string]: string}

A mapping of tags to assign to the resource.

authorized_resource_ids Sequence[str]

A list of IDs of Resources referred into query.

criteria ScheduledQueryRulesLogCriteriaArgs

A criteria block as defined below.

data_source_id str

The resource URI over which log search query is to be run.

description str

The description of the scheduled query rule.

enabled bool

Whether this scheduled query rule is enabled. Default is true.

location str

Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.

name str

The name of the scheduled query rule. Changing this forces a new resource to be created.

resource_group_name str

The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.

tags Mapping[str, str]

A mapping of tags to assign to the resource.

authorizedResourceIds List<String>

A list of IDs of Resources referred into query.

criteria Property Map

A criteria block as defined below.

dataSourceId String

The resource URI over which log search query is to be run.

description String

The description of the scheduled query rule.

enabled Boolean

Whether this scheduled query rule is enabled. Default is true.

location String

Specifies the Azure Region where the resource should exist. Changing this forces a new resource to be created.

name String

The name of the scheduled query rule. Changing this forces a new resource to be created.

resourceGroupName String

The name of the resource group in which to create the scheduled query rule instance. Changing this forces a new resource to be created.

tags Map<String>

A mapping of tags to assign to the resource.

Supporting Types

ScheduledQueryRulesLogCriteria

Dimensions List<ScheduledQueryRulesLogCriteriaDimension>

A dimension block as defined below.

MetricName string

Name of the metric. Supported metrics are listed in the Azure Monitor Microsoft.OperationalInsights/workspaces metrics namespace.

Dimensions []ScheduledQueryRulesLogCriteriaDimension

A dimension block as defined below.

MetricName string

Name of the metric. Supported metrics are listed in the Azure Monitor Microsoft.OperationalInsights/workspaces metrics namespace.

dimensions List<ScheduledQueryRulesLogCriteriaDimension>

A dimension block as defined below.

metricName String

Name of the metric. Supported metrics are listed in the Azure Monitor Microsoft.OperationalInsights/workspaces metrics namespace.

dimensions ScheduledQueryRulesLogCriteriaDimension[]

A dimension block as defined below.

metricName string

Name of the metric. Supported metrics are listed in the Azure Monitor Microsoft.OperationalInsights/workspaces metrics namespace.

dimensions Sequence[ScheduledQueryRulesLogCriteriaDimension]

A dimension block as defined below.

metric_name str

Name of the metric. Supported metrics are listed in the Azure Monitor Microsoft.OperationalInsights/workspaces metrics namespace.

dimensions List<Property Map>

A dimension block as defined below.

metricName String

Name of the metric. Supported metrics are listed in the Azure Monitor Microsoft.OperationalInsights/workspaces metrics namespace.

ScheduledQueryRulesLogCriteriaDimension

Name string

Name of the dimension.

Values List<string>

List of dimension values.

Operator string

Operator for dimension values, - 'Include'.

Name string

Name of the dimension.

Values []string

List of dimension values.

Operator string

Operator for dimension values, - 'Include'.

name String

Name of the dimension.

values List<String>

List of dimension values.

operator String

Operator for dimension values, - 'Include'.

name string

Name of the dimension.

values string[]

List of dimension values.

operator string

Operator for dimension values, - 'Include'.

name str

Name of the dimension.

values Sequence[str]

List of dimension values.

operator str

Operator for dimension values, - 'Include'.

name String

Name of the dimension.

values List<String>

List of dimension values.

operator String

Operator for dimension values, - 'Include'.

Import

Scheduled Query Rule Log can be imported using the resource id, e.g.

 $ pulumi import azure:monitoring/scheduledQueryRulesLog:ScheduledQueryRulesLog example /subscriptions/00000000-0000-0000-0000-000000000000/resourceGroups/group1/providers/Microsoft.Insights/scheduledQueryRules/myrulename

Package Details

Repository
Azure Classic pulumi/pulumi-azure
License
Apache-2.0
Notes

This Pulumi package is based on the azurerm Terraform Provider.