1. Packages
  2. Azure Native v1
  3. API Docs
  4. operationalinsights
  5. SavedSearch
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

azure-native.operationalinsights.SavedSearch

Explore with Pulumi AI

azure-native-v1 logo
These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi

    Value object for saved search results. API Version: 2020-08-01.

    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 (
    	operationalinsights "github.com/pulumi/pulumi-azure-native-sdk/operationalinsights"
    	"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.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 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(Map.ofEntries(
                    Map.entry("name", "Group"),
                    Map.entry("value", "Computer")
                ))
                .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.

    Constructor 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[]
        {
            
            {
                { "name", "string" },
                { "value", "string" },
            },
        },
        Version = 0,
    });
    
    example, err := operationalinsights.NewSavedSearch(ctx, "savedSearchResource", &operationalinsights.SavedSearchArgs{
    	Category:           "string",
    	DisplayName:        "string",
    	Query:              "string",
    	ResourceGroupName:  "string",
    	WorkspaceName:      "string",
    	FunctionAlias:      "string",
    	FunctionParameters: "string",
    	SavedSearchId:      "string",
    	Tags: []map[string]interface{}{
    		map[string]interface{}{
    			"name":  "string",
    			"value": "string",
    		},
    	},
    	Version: 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(%!v(PANIC=Format method: runtime error: invalid memory address or nil pointer dereference))
        .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=[{
            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/00000000-0000-0000-0000-000000000005/resourceGroups/mms-eus/providers/Microsoft.OperationalInsights/workspaces/AtlantisDemo/savedSearches/test-new-saved-search-id-2015 
    

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

    Package Details

    Repository
    azure-native-v1 pulumi/pulumi-azure-native
    License
    Apache-2.0
    azure-native-v1 logo
    These are the docs for Azure Native v1. We recommenend using the latest version, Azure Native v2.
    Azure Native v1 v1.104.0 published on Thursday, Jul 6, 2023 by Pulumi