1. Packages
  2. Newrelic Provider
  3. API Docs
  4. getTestGrokPattern
New Relic v5.44.0 published on Saturday, Mar 29, 2025 by Pulumi

newrelic.getTestGrokPattern

Explore with Pulumi AI

New Relic v5.44.0 published on Saturday, Mar 29, 2025 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",
    ],
});
Copy
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",
    ])
Copy
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
	})
}
Copy
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",
        },
    });

});
Copy
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());

    }
}
Copy
variables:
  # Data source
  foo:
    fn::invoke:
      function: newrelic:getTestGrokPattern
      arguments:
        grok: '%{IP:host_ip}'
        logLines:
          - 'host_ip: 43.3.120.2'
          - 'bytes_received: 2048'
Copy

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>
Copy
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]
Copy
func GetTestGrokPattern(ctx *Context, args *GetTestGrokPatternArgs, opts ...InvokeOption) (*GetTestGrokPatternResult, error)
func GetTestGrokPatternOutput(ctx *Context, args *GetTestGrokPatternOutputArgs, opts ...InvokeOption) GetTestGrokPatternResultOutput
Copy

> 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)
}
Copy
public static CompletableFuture<GetTestGrokPatternResult> getTestGrokPattern(GetTestGrokPatternArgs args, InvokeOptions options)
public static Output<GetTestGrokPatternResult> getTestGrokPattern(GetTestGrokPatternArgs args, InvokeOptions options)
Copy
fn::invoke:
  function: newrelic:index/getTestGrokPattern:getTestGrokPattern
  arguments:
    # arguments dictionary
Copy

The following arguments are supported:

Grok This property is required. string
The Grok pattern to test.
LogLines This property is required. 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 This property is required. string
The Grok pattern to test.
LogLines This property is required. []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 This property is required. String
The Grok pattern to test.
logLines This property is required. 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 This property is required. string
The Grok pattern to test.
logLines This property is required. 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 This property is required. str
The Grok pattern to test.
log_lines This property is required. 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 This property is required. String
The Grok pattern to test.
logLines This property is required. 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 This property is required. List<Pulumi.NewRelic.Inputs.GetTestGrokPatternTestGrokAttribute>
Nested list containing information about any attributes that were extracted.
LogLine This property is required. string
The log line that was tested against.
Matched This property is required. bool
Whether the Grok pattern matched.
Attributes This property is required. []GetTestGrokPatternTestGrokAttribute
Nested list containing information about any attributes that were extracted.
LogLine This property is required. string
The log line that was tested against.
Matched This property is required. bool
Whether the Grok pattern matched.
attributes This property is required. List<GetTestGrokPatternTestGrokAttribute>
Nested list containing information about any attributes that were extracted.
logLine This property is required. String
The log line that was tested against.
matched This property is required. Boolean
Whether the Grok pattern matched.
attributes This property is required. GetTestGrokPatternTestGrokAttribute[]
Nested list containing information about any attributes that were extracted.
logLine This property is required. string
The log line that was tested against.
matched This property is required. boolean
Whether the Grok pattern matched.
attributes This property is required. Sequence[GetTestGrokPatternTestGrokAttribute]
Nested list containing information about any attributes that were extracted.
log_line This property is required. str
The log line that was tested against.
matched This property is required. bool
Whether the Grok pattern matched.
attributes This property is required. List<Property Map>
Nested list containing information about any attributes that were extracted.
logLine This property is required. String
The log line that was tested against.
matched This property is required. Boolean
Whether the Grok pattern matched.

GetTestGrokPatternTestGrokAttribute

Name This property is required. string
The attribute name.
Value This property is required. string
A string representation of the extracted value (which might not be a String).
Name This property is required. string
The attribute name.
Value This property is required. string
A string representation of the extracted value (which might not be a String).
name This property is required. String
The attribute name.
value This property is required. String
A string representation of the extracted value (which might not be a String).
name This property is required. string
The attribute name.
value This property is required. string
A string representation of the extracted value (which might not be a String).
name This property is required. str
The attribute name.
value This property is required. str
A string representation of the extracted value (which might not be a String).
name This property is required. String
The attribute name.
value This property is required. 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.
New Relic v5.44.0 published on Saturday, Mar 29, 2025 by Pulumi