Viewing docs for New Relic v5.62.0
published on Saturday, Mar 14, 2026 by Pulumi
published on Saturday, Mar 14, 2026 by Pulumi
Viewing docs for New Relic v5.62.0
published on Saturday, Mar 14, 2026 by Pulumi
published on Saturday, Mar 14, 2026 by Pulumi
Use this data source to validate a grok pattern. More information on Terraform’s data sources can be found here.
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)
public static Output<GetTestGrokPatternResult> getTestGrokPattern(GetTestGrokPatternArgs args, InvokeOptions options)
fn::invoke:
function: newrelic:index/getTestGrokPattern:getTestGrokPattern
arguments:
# arguments dictionaryThe following arguments are supported:
- 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_idattribute set on the provider. Defaults to the environment variableNEW_RELIC_ACCOUNT_ID.
getTestGrokPattern Result
The following output properties are available:
- grok str
- id str
- The provider-assigned unique ID for this managed resource.
- log_
lines Sequence[str] - test_
groks Sequence[GetTest Grok Pattern Test Grok] - Nested attribute containing information about the test of Grok pattern against a list of log lines.
- account_
id str
Supporting Types
GetTestGrokPatternTestGrok
- Attributes
List<Pulumi.
New Relic. Inputs. Get Test Grok Pattern Test Grok Attribute> - Nested list containing information about any attributes that were extracted.
- Log
Line string - The log line that was tested against.
- Matched bool
- Whether the Grok pattern matched.
- Attributes
[]Get
Test Grok Pattern Test Grok Attribute - Nested list containing information about any attributes that were extracted.
- Log
Line string - The log line that was tested against.
- Matched bool
- Whether the Grok pattern matched.
- attributes
List<Get
Test Grok Pattern Test Grok Attribute> - Nested list containing information about any attributes that were extracted.
- log
Line String - The log line that was tested against.
- matched Boolean
- Whether the Grok pattern matched.
- attributes
Get
Test Grok Pattern Test Grok Attribute[] - Nested list containing information about any attributes that were extracted.
- log
Line string - The log line that was tested against.
- matched boolean
- Whether the Grok pattern matched.
- attributes
Sequence[Get
Test Grok Pattern Test Grok Attribute] - 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.
- log
Line String - The log line that was tested against.
- matched Boolean
- Whether the Grok pattern matched.
GetTestGrokPatternTestGrokAttribute
Package Details
- Repository
- New Relic pulumi/pulumi-newrelic
- License
- Apache-2.0
- Notes
- This Pulumi package is based on the
newrelicTerraform Provider.
Viewing docs for New Relic v5.62.0
published on Saturday, Mar 14, 2026 by Pulumi
published on Saturday, Mar 14, 2026 by Pulumi
