1. Packages
  2. Azure Native
  3. API Docs
  4. operationalinsights
  5. SavedSearch
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.37.0 published on Monday, Apr 15, 2024 by Pulumi

azure-native.operationalinsights.SavedSearch

Explore with Pulumi AI

azure-native logo
This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
Azure Native v2.37.0 published on Monday, Apr 15, 2024 by Pulumi

    Value object for saved search results. Azure REST API version: 2020-08-01. Prior API version in Azure Native 1.x: 2020-08-01.

    Other available API versions: 2015-03-20.

    Example Usage

    SavedSearchCreateOrUpdate

    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using AzureNative = Pulumi.AzureNative;
    
    return await Deployment.RunAsync(() => 
    {
        var savedSearch = new AzureNative.OperationalInsights.SavedSearch("savedSearch", new()
        {
            Category = "Saved Search Test Category",
            DisplayName = "Create or Update Saved Search Test",
            FunctionAlias = "heartbeat_func",
            FunctionParameters = "a:int=1",
            Query = "Heartbeat | summarize Count() by Computer | take a",
            ResourceGroupName = "TestRG",
            SavedSearchId = "00000000-0000-0000-0000-00000000000",
            Tags = new[]
            {
                new AzureNative.OperationalInsights.Inputs.TagArgs
                {
                    Name = "Group",
                    Value = "Computer",
                },
            },
            Version = 2,
            WorkspaceName = "TestWS",
        });
    
    });
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-azure-native-sdk/operationalinsights/v2"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		_, err := operationalinsights.NewSavedSearch(ctx, "savedSearch", &operationalinsights.SavedSearchArgs{
    			Category:           pulumi.String("Saved Search Test Category"),
    			DisplayName:        pulumi.String("Create or Update Saved Search Test"),
    			FunctionAlias:      pulumi.String("heartbeat_func"),
    			FunctionParameters: pulumi.String("a:int=1"),
    			Query:              pulumi.String("Heartbeat | summarize Count() by Computer | take a"),
    			ResourceGroupName:  pulumi.String("TestRG"),
    			SavedSearchId:      pulumi.String("00000000-0000-0000-0000-00000000000"),
    			Tags: operationalinsights.TagArray{
    				&operationalinsights.TagArgs{
    					Name:  pulumi.String("Group"),
    					Value: pulumi.String("Computer"),
    				},
    			},
    			Version:       pulumi.Float64(2),
    			WorkspaceName: pulumi.String("TestWS"),
    		})
    		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.azurenative.operationalinsights.SavedSearch;
    import com.pulumi.azurenative.operationalinsights.SavedSearchArgs;
    import com.pulumi.azurenative.operationalinsights.inputs.TagArgs;
    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 savedSearch = new SavedSearch("savedSearch", SavedSearchArgs.builder()        
                .category("Saved Search Test Category")
                .displayName("Create or Update Saved Search Test")
                .functionAlias("heartbeat_func")
                .functionParameters("a:int=1")
                .query("Heartbeat | summarize Count() by Computer | take a")
                .resourceGroupName("TestRG")
                .savedSearchId("00000000-0000-0000-0000-00000000000")
                .tags(TagArgs.builder()
                    .name("Group")
                    .value("Computer")
                    .build())
                .version(2)
                .workspaceName("TestWS")
                .build());
    
        }
    }
    
    import pulumi
    import pulumi_azure_native as azure_native
    
    saved_search = azure_native.operationalinsights.SavedSearch("savedSearch",
        category="Saved Search Test Category",
        display_name="Create or Update Saved Search Test",
        function_alias="heartbeat_func",
        function_parameters="a:int=1",
        query="Heartbeat | summarize Count() by Computer | take a",
        resource_group_name="TestRG",
        saved_search_id="00000000-0000-0000-0000-00000000000",
        tags=[azure_native.operationalinsights.TagArgs(
            name="Group",
            value="Computer",
        )],
        version=2,
        workspace_name="TestWS")
    
    import * as pulumi from "@pulumi/pulumi";
    import * as azure_native from "@pulumi/azure-native";
    
    const savedSearch = new azure_native.operationalinsights.SavedSearch("savedSearch", {
        category: "Saved Search Test Category",
        displayName: "Create or Update Saved Search Test",
        functionAlias: "heartbeat_func",
        functionParameters: "a:int=1",
        query: "Heartbeat | summarize Count() by Computer | take a",
        resourceGroupName: "TestRG",
        savedSearchId: "00000000-0000-0000-0000-00000000000",
        tags: [{
            name: "Group",
            value: "Computer",
        }],
        version: 2,
        workspaceName: "TestWS",
    });
    
    resources:
      savedSearch:
        type: azure-native:operationalinsights:SavedSearch
        properties:
          category: Saved Search Test Category
          displayName: Create or Update Saved Search Test
          functionAlias: heartbeat_func
          functionParameters: a:int=1
          query: Heartbeat | summarize Count() by Computer | take a
          resourceGroupName: TestRG
          savedSearchId: 00000000-0000-0000-0000-00000000000
          tags:
            - name: Group
              value: Computer
          version: 2
          workspaceName: TestWS
    

    Create SavedSearch Resource

    Resources are created with functions called constructors. To learn more about declaring and configuring resources, see Resources.

    Constructor syntax

    new SavedSearch(name: string, args: SavedSearchArgs, opts?: CustomResourceOptions);
    @overload
    def SavedSearch(resource_name: str,
                    args: SavedSearchArgs,
                    opts: Optional[ResourceOptions] = None)
    
    @overload
    def SavedSearch(resource_name: str,
                    opts: Optional[ResourceOptions] = None,
                    category: Optional[str] = None,
                    display_name: Optional[str] = None,
                    query: Optional[str] = None,
                    resource_group_name: Optional[str] = None,
                    workspace_name: Optional[str] = None,
                    function_alias: Optional[str] = None,
                    function_parameters: Optional[str] = None,
                    saved_search_id: Optional[str] = None,
                    tags: Optional[Sequence[TagArgs]] = None,
                    version: Optional[float] = None)
    func NewSavedSearch(ctx *Context, name string, args SavedSearchArgs, opts ...ResourceOption) (*SavedSearch, error)
    public SavedSearch(string name, SavedSearchArgs args, CustomResourceOptions? opts = null)
    public SavedSearch(String name, SavedSearchArgs args)
    public SavedSearch(String name, SavedSearchArgs args, CustomResourceOptions options)
    
    type: azure-native:operationalinsights:SavedSearch
    properties: # The arguments to resource properties.
    options: # Bag of options to control resource's behavior.
    
    

    Parameters

    name string
    The unique name of the resource.
    args SavedSearchArgs
    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 SavedSearchArgs
    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 SavedSearchArgs
    The arguments to resource properties.
    opts ResourceOption
    Bag of options to control resource's behavior.
    name string
    The unique name of the resource.
    args SavedSearchArgs
    The arguments to resource properties.
    opts CustomResourceOptions
    Bag of options to control resource's behavior.
    name String
    The unique name of the resource.
    args SavedSearchArgs
    The arguments to resource properties.
    options CustomResourceOptions
    Bag of options to control resource's behavior.

    Example

    The following reference example uses placeholder values for all input properties.

    var savedSearchResource = new AzureNative.OperationalInsights.SavedSearch("savedSearchResource", new()
    {
        Category = "string",
        DisplayName = "string",
        Query = "string",
        ResourceGroupName = "string",
        WorkspaceName = "string",
        FunctionAlias = "string",
        FunctionParameters = "string",
        SavedSearchId = "string",
        Tags = new[]
        {
            new AzureNative.OperationalInsights.Inputs.TagArgs
            {
                Name = "string",
                Value = "string",
            },
        },
        Version = 0,
    });
    
    example, err := operationalinsights.NewSavedSearch(ctx, "savedSearchResource", &operationalinsights.SavedSearchArgs{
    Category: pulumi.String("string"),
    DisplayName: pulumi.String("string"),
    Query: pulumi.String("string"),
    ResourceGroupName: pulumi.String("string"),
    WorkspaceName: pulumi.String("string"),
    FunctionAlias: pulumi.String("string"),
    FunctionParameters: pulumi.String("string"),
    SavedSearchId: pulumi.String("string"),
    Tags: operationalinsights.TagArray{
    &operationalinsights.TagArgs{
    Name: pulumi.String("string"),
    Value: pulumi.String("string"),
    },
    },
    Version: pulumi.Float64(0),
    })
    
    var savedSearchResource = new SavedSearch("savedSearchResource", SavedSearchArgs.builder()        
        .category("string")
        .displayName("string")
        .query("string")
        .resourceGroupName("string")
        .workspaceName("string")
        .functionAlias("string")
        .functionParameters("string")
        .savedSearchId("string")
        .tags(TagArgs.builder()
            .name("string")
            .value("string")
            .build())
        .version(0)
        .build());
    
    saved_search_resource = azure_native.operationalinsights.SavedSearch("savedSearchResource",
        category="string",
        display_name="string",
        query="string",
        resource_group_name="string",
        workspace_name="string",
        function_alias="string",
        function_parameters="string",
        saved_search_id="string",
        tags=[azure_native.operationalinsights.TagArgs(
            name="string",
            value="string",
        )],
        version=0)
    
    const savedSearchResource = new azure_native.operationalinsights.SavedSearch("savedSearchResource", {
        category: "string",
        displayName: "string",
        query: "string",
        resourceGroupName: "string",
        workspaceName: "string",
        functionAlias: "string",
        functionParameters: "string",
        savedSearchId: "string",
        tags: [{
            name: "string",
            value: "string",
        }],
        version: 0,
    });
    
    type: azure-native:operationalinsights:SavedSearch
    properties:
        category: string
        displayName: string
        functionAlias: string
        functionParameters: string
        query: string
        resourceGroupName: string
        savedSearchId: string
        tags:
            - name: string
              value: string
        version: 0
        workspaceName: string
    

    SavedSearch 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 SavedSearch resource accepts the following input properties:

    Category string
    The category of the saved search. This helps the user to find a saved search faster.
    DisplayName string
    Saved search display name.
    Query string
    The query expression for the saved search.
    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    WorkspaceName string
    The name of the workspace.
    FunctionAlias string
    The function alias if query serves as a function.
    FunctionParameters string
    The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions.
    SavedSearchId string
    The id of the saved search.
    Tags List<Pulumi.AzureNative.OperationalInsights.Inputs.Tag>
    The tags attached to the saved search.
    Version double
    The version number of the query language. The current version is 2 and is the default.
    Category string
    The category of the saved search. This helps the user to find a saved search faster.
    DisplayName string
    Saved search display name.
    Query string
    The query expression for the saved search.
    ResourceGroupName string
    The name of the resource group. The name is case insensitive.
    WorkspaceName string
    The name of the workspace.
    FunctionAlias string
    The function alias if query serves as a function.
    FunctionParameters string
    The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions.
    SavedSearchId string
    The id of the saved search.
    Tags []TagArgs
    The tags attached to the saved search.
    Version float64
    The version number of the query language. The current version is 2 and is the default.
    category String
    The category of the saved search. This helps the user to find a saved search faster.
    displayName String
    Saved search display name.
    query String
    The query expression for the saved search.
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    workspaceName String
    The name of the workspace.
    functionAlias String
    The function alias if query serves as a function.
    functionParameters String
    The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions.
    savedSearchId String
    The id of the saved search.
    tags List<Tag>
    The tags attached to the saved search.
    version Double
    The version number of the query language. The current version is 2 and is the default.
    category string
    The category of the saved search. This helps the user to find a saved search faster.
    displayName string
    Saved search display name.
    query string
    The query expression for the saved search.
    resourceGroupName string
    The name of the resource group. The name is case insensitive.
    workspaceName string
    The name of the workspace.
    functionAlias string
    The function alias if query serves as a function.
    functionParameters string
    The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions.
    savedSearchId string
    The id of the saved search.
    tags Tag[]
    The tags attached to the saved search.
    version number
    The version number of the query language. The current version is 2 and is the default.
    category str
    The category of the saved search. This helps the user to find a saved search faster.
    display_name str
    Saved search display name.
    query str
    The query expression for the saved search.
    resource_group_name str
    The name of the resource group. The name is case insensitive.
    workspace_name str
    The name of the workspace.
    function_alias str
    The function alias if query serves as a function.
    function_parameters str
    The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions.
    saved_search_id str
    The id of the saved search.
    tags Sequence[TagArgs]
    The tags attached to the saved search.
    version float
    The version number of the query language. The current version is 2 and is the default.
    category String
    The category of the saved search. This helps the user to find a saved search faster.
    displayName String
    Saved search display name.
    query String
    The query expression for the saved search.
    resourceGroupName String
    The name of the resource group. The name is case insensitive.
    workspaceName String
    The name of the workspace.
    functionAlias String
    The function alias if query serves as a function.
    functionParameters String
    The optional function parameters if query serves as a function. Value should be in the following format: 'param-name1:type1 = default_value1, param-name2:type2 = default_value2'. For more examples and proper syntax please refer to https://docs.microsoft.com/en-us/azure/kusto/query/functions/user-defined-functions.
    savedSearchId String
    The id of the saved search.
    tags List<Property Map>
    The tags attached to the saved search.
    version Number
    The version number of the query language. The current version is 2 and is the default.

    Outputs

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

    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the resource
    Type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    Etag string
    The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag
    Id string
    The provider-assigned unique ID for this managed resource.
    Name string
    The name of the resource
    Type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    Etag string
    The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the resource
    type String
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    etag String
    The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag
    id string
    The provider-assigned unique ID for this managed resource.
    name string
    The name of the resource
    type string
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    etag string
    The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag
    id str
    The provider-assigned unique ID for this managed resource.
    name str
    The name of the resource
    type str
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    etag str
    The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag
    id String
    The provider-assigned unique ID for this managed resource.
    name String
    The name of the resource
    type String
    The type of the resource. E.g. "Microsoft.Compute/virtualMachines" or "Microsoft.Storage/storageAccounts"
    etag String
    The ETag of the saved search. To override an existing saved search, use "*" or specify the current Etag

    Supporting Types

    Tag, TagArgs

    Name string
    The tag name.
    Value string
    The tag value.
    Name string
    The tag name.
    Value string
    The tag value.
    name String
    The tag name.
    value String
    The tag value.
    name string
    The tag name.
    value string
    The tag value.
    name str
    The tag name.
    value str
    The tag value.
    name String
    The tag name.
    value String
    The tag value.

    TagResponse, TagResponseArgs

    Name string
    The tag name.
    Value string
    The tag value.
    Name string
    The tag name.
    Value string
    The tag value.
    name String
    The tag name.
    value String
    The tag value.
    name string
    The tag name.
    value string
    The tag value.
    name str
    The tag name.
    value str
    The tag value.
    name String
    The tag name.
    value String
    The tag value.

    Import

    An existing resource can be imported using its type token, name, and identifier, e.g.

    $ pulumi import azure-native:operationalinsights:SavedSearch myresource1 /subscriptions/{subscriptionId}/resourcegroups/{resourceGroupName}/providers/Microsoft.OperationalInsights/workspaces/{workspaceName}/savedSearches/{savedSearchId} 
    

    To learn more about importing existing cloud resources, see Importing resources.

    Package Details

    Repository
    Azure Native pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native logo
    This is the latest version of Azure Native. Use the Azure Native v1 docs if using the v1 version of this package.
    Azure Native v2.37.0 published on Monday, Apr 15, 2024 by Pulumi