1. Packages
  2. New Relic
  3. API Docs
  4. getTestGrokPattern
New Relic v5.36.1 published on Tuesday, Nov 12, 2024 by Pulumi

newrelic.getTestGrokPattern

Explore with Pulumi AI

newrelic logo
New Relic v5.36.1 published on Tuesday, Nov 12, 2024 by Pulumi

    Example Usage

    import * as pulumi from "@pulumi/pulumi";
    import * as newrelic from "@pulumi/newrelic";
    
    // Data source
    const foo = newrelic.getTestGrokPattern({
        grok: "%{IP:host_ip}",
        logLines: [
            "host_ip: 43.3.120.2",
            "bytes_received: 2048",
        ],
    });
    
    import pulumi
    import pulumi_newrelic as newrelic
    
    # Data source
    foo = newrelic.get_test_grok_pattern(grok="%{IP:host_ip}",
        log_lines=[
            "host_ip: 43.3.120.2",
            "bytes_received: 2048",
        ])
    
    package main
    
    import (
    	"github.com/pulumi/pulumi-newrelic/sdk/v5/go/newrelic"
    	"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
    )
    
    func main() {
    	pulumi.Run(func(ctx *pulumi.Context) error {
    		// Data source
    		_, err := newrelic.GetTestGrokPattern(ctx, &newrelic.GetTestGrokPatternArgs{
    			Grok: "%{IP:host_ip}",
    			LogLines: []string{
    				"host_ip: 43.3.120.2",
    				"bytes_received: 2048",
    			},
    		}, nil)
    		if err != nil {
    			return err
    		}
    		return nil
    	})
    }
    
    using System.Collections.Generic;
    using System.Linq;
    using Pulumi;
    using NewRelic = Pulumi.NewRelic;
    
    return await Deployment.RunAsync(() => 
    {
        // Data source
        var foo = NewRelic.GetTestGrokPattern.Invoke(new()
        {
            Grok = "%{IP:host_ip}",
            LogLines = new[]
            {
                "host_ip: 43.3.120.2",
                "bytes_received: 2048",
            },
        });
    
    });
    
    package generated_program;
    
    import com.pulumi.Context;
    import com.pulumi.Pulumi;
    import com.pulumi.core.Output;
    import com.pulumi.newrelic.NewrelicFunctions;
    import com.pulumi.newrelic.inputs.GetTestGrokPatternArgs;
    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) {
            // Data source
            final var foo = NewrelicFunctions.getTestGrokPattern(GetTestGrokPatternArgs.builder()
                .grok("%{IP:host_ip}")
                .logLines(            
                    "host_ip: 43.3.120.2",
                    "bytes_received: 2048")
                .build());
    
        }
    }
    
    variables:
      # Data source
      foo:
        fn::invoke:
          Function: newrelic:getTestGrokPattern
          Arguments:
            grok: '%{IP:host_ip}'
            logLines:
              - 'host_ip: 43.3.120.2'
              - 'bytes_received: 2048'
    

    Using getTestGrokPattern

    Two invocation forms are available. The direct form accepts plain arguments and either blocks until the result value is available, or returns a Promise-wrapped result. The output form accepts Input-wrapped arguments and returns an Output-wrapped result.

    function getTestGrokPattern(args: GetTestGrokPatternArgs, opts?: InvokeOptions): Promise<GetTestGrokPatternResult>
    function getTestGrokPatternOutput(args: GetTestGrokPatternOutputArgs, opts?: InvokeOptions): Output<GetTestGrokPatternResult>
    def get_test_grok_pattern(account_id: Optional[str] = None,
                              grok: Optional[str] = None,
                              log_lines: Optional[Sequence[str]] = None,
                              opts: Optional[InvokeOptions] = None) -> GetTestGrokPatternResult
    def get_test_grok_pattern_output(account_id: Optional[pulumi.Input[str]] = None,
                              grok: Optional[pulumi.Input[str]] = None,
                              log_lines: Optional[pulumi.Input[Sequence[pulumi.Input[str]]]] = None,
                              opts: Optional[InvokeOptions] = None) -> Output[GetTestGrokPatternResult]
    func GetTestGrokPattern(ctx *Context, args *GetTestGrokPatternArgs, opts ...InvokeOption) (*GetTestGrokPatternResult, error)
    func GetTestGrokPatternOutput(ctx *Context, args *GetTestGrokPatternOutputArgs, opts ...InvokeOption) GetTestGrokPatternResultOutput

    > Note: This function is named GetTestGrokPattern in the Go SDK.

    public static class GetTestGrokPattern 
    {
        public static Task<GetTestGrokPatternResult> InvokeAsync(GetTestGrokPatternArgs args, InvokeOptions? opts = null)
        public static Output<GetTestGrokPatternResult> Invoke(GetTestGrokPatternInvokeArgs args, InvokeOptions? opts = null)
    }
    public static CompletableFuture<GetTestGrokPatternResult> getTestGrokPattern(GetTestGrokPatternArgs args, InvokeOptions options)
    // Output-based functions aren't available in Java yet
    
    fn::invoke:
      function: newrelic:index/getTestGrokPattern:getTestGrokPattern
      arguments:
        # arguments dictionary

    The following arguments are supported:

    Grok string
    The Grok pattern to test.
    LogLines List<string>
    The log lines to test the Grok pattern against.
    AccountId string
    The New Relic account ID to operate on. This allows you to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.
    Grok string
    The Grok pattern to test.
    LogLines []string
    The log lines to test the Grok pattern against.
    AccountId string
    The New Relic account ID to operate on. This allows you to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.
    grok String
    The Grok pattern to test.
    logLines List<String>
    The log lines to test the Grok pattern against.
    accountId String
    The New Relic account ID to operate on. This allows you to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.
    grok string
    The Grok pattern to test.
    logLines string[]
    The log lines to test the Grok pattern against.
    accountId string
    The New Relic account ID to operate on. This allows you to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.
    grok str
    The Grok pattern to test.
    log_lines Sequence[str]
    The log lines to test the Grok pattern against.
    account_id str
    The New Relic account ID to operate on. This allows you to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.
    grok String
    The Grok pattern to test.
    logLines List<String>
    The log lines to test the Grok pattern against.
    accountId String
    The New Relic account ID to operate on. This allows you to override the account_id attribute set on the provider. Defaults to the environment variable NEW_RELIC_ACCOUNT_ID.

    getTestGrokPattern Result

    The following output properties are available:

    Grok string
    Id string
    The provider-assigned unique ID for this managed resource.
    LogLines List<string>
    TestGroks List<Pulumi.NewRelic.Outputs.GetTestGrokPatternTestGrok>
    Nested attribute containing information about the test of Grok pattern against a list of log lines.
    AccountId string
    Grok string
    Id string
    The provider-assigned unique ID for this managed resource.
    LogLines []string
    TestGroks []GetTestGrokPatternTestGrok
    Nested attribute containing information about the test of Grok pattern against a list of log lines.
    AccountId string
    grok String
    id String
    The provider-assigned unique ID for this managed resource.
    logLines List<String>
    testGroks List<GetTestGrokPatternTestGrok>
    Nested attribute containing information about the test of Grok pattern against a list of log lines.
    accountId String
    grok string
    id string
    The provider-assigned unique ID for this managed resource.
    logLines string[]
    testGroks GetTestGrokPatternTestGrok[]
    Nested attribute containing information about the test of Grok pattern against a list of log lines.
    accountId string
    grok str
    id str
    The provider-assigned unique ID for this managed resource.
    log_lines Sequence[str]
    test_groks Sequence[GetTestGrokPatternTestGrok]
    Nested attribute containing information about the test of Grok pattern against a list of log lines.
    account_id str
    grok String
    id String
    The provider-assigned unique ID for this managed resource.
    logLines List<String>
    testGroks List<Property Map>
    Nested attribute containing information about the test of Grok pattern against a list of log lines.
    accountId String

    Supporting Types

    GetTestGrokPatternTestGrok

    Attributes List<Pulumi.NewRelic.Inputs.GetTestGrokPatternTestGrokAttribute>
    Nested list containing information about any attributes that were extracted.
    LogLine string
    The log line that was tested against.
    Matched bool
    Whether the Grok pattern matched.
    Attributes []GetTestGrokPatternTestGrokAttribute
    Nested list containing information about any attributes that were extracted.
    LogLine string
    The log line that was tested against.
    Matched bool
    Whether the Grok pattern matched.
    attributes List<GetTestGrokPatternTestGrokAttribute>
    Nested list containing information about any attributes that were extracted.
    logLine String
    The log line that was tested against.
    matched Boolean
    Whether the Grok pattern matched.
    attributes GetTestGrokPatternTestGrokAttribute[]
    Nested list containing information about any attributes that were extracted.
    logLine string
    The log line that was tested against.
    matched boolean
    Whether the Grok pattern matched.
    attributes Sequence[GetTestGrokPatternTestGrokAttribute]
    Nested list containing information about any attributes that were extracted.
    log_line str
    The log line that was tested against.
    matched bool
    Whether the Grok pattern matched.
    attributes List<Property Map>
    Nested list containing information about any attributes that were extracted.
    logLine String
    The log line that was tested against.
    matched Boolean
    Whether the Grok pattern matched.

    GetTestGrokPatternTestGrokAttribute

    Name string
    The attribute name.
    Value string
    A string representation of the extracted value (which might not be a String).
    Name string
    The attribute name.
    Value string
    A string representation of the extracted value (which might not be a String).
    name String
    The attribute name.
    value String
    A string representation of the extracted value (which might not be a String).
    name string
    The attribute name.
    value string
    A string representation of the extracted value (which might not be a String).
    name str
    The attribute name.
    value str
    A string representation of the extracted value (which might not be a String).
    name String
    The attribute name.
    value String
    A string representation of the extracted value (which might not be a String).

    Package Details

    Repository
    New Relic pulumi/pulumi-newrelic
    License
    Apache-2.0
    Notes
    This Pulumi package is based on the newrelic Terraform Provider.
    newrelic logo
    New Relic v5.36.1 published on Tuesday, Nov 12, 2024 by Pulumi