Parser class
A parser is a configuration that parses raw logs of a specific log type into Unified Data Model (UDM) events. Chronicle supports both customer-created custom parsers and Google-provided prebuilt parsers.
To get more information about Parser, see:
- API documentation
- How-to Guides
- Custom parsers overview
Example Usage
Chronicle Parser Basic
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const example = new gcp.chronicle.Parser("example", {
location: "us",
instance: "00000000-0000-0000-0000-000000000000",
logtype: "WINDOWS_DHCP",
validationSkipped: true,
cbn: "ZHVtbXkgcGFyc2VyIGNvbmZpZw==",
});
import pulumi
import pulumi_gcp as gcp
example = gcp.chronicle.Parser("example",
location="us",
instance="00000000-0000-0000-0000-000000000000",
logtype="WINDOWS_DHCP",
validation_skipped=True,
cbn="ZHVtbXkgcGFyc2VyIGNvbmZpZw==")
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var example = new Gcp.Chronicle.Parser("example", new()
{
Location = "us",
Instance = "00000000-0000-0000-0000-000000000000",
Logtype = "WINDOWS_DHCP",
ValidationSkipped = true,
Cbn = "ZHVtbXkgcGFyc2VyIGNvbmZpZw==",
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/chronicle"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := chronicle.NewParser(ctx, "example", &chronicle.ParserArgs{
Location: pulumi.String("us"),
Instance: pulumi.String("00000000-0000-0000-0000-000000000000"),
Logtype: pulumi.String("WINDOWS_DHCP"),
ValidationSkipped: pulumi.Bool(true),
Cbn: pulumi.String("ZHVtbXkgcGFyc2VyIGNvbmZpZw=="),
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_chronicle_parser" "example" {
location = "us"
instance = "00000000-0000-0000-0000-000000000000"
logtype = "WINDOWS_DHCP"
validation_skipped = true
cbn = "ZHVtbXkgcGFyc2VyIGNvbmZpZw=="
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.chronicle.Parser;
import com.pulumi.gcp.chronicle.ParserArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new Parser("example", ParserArgs.builder()
.location("us")
.instance("00000000-0000-0000-0000-000000000000")
.logtype("WINDOWS_DHCP")
.validationSkipped(true)
.cbn("ZHVtbXkgcGFyc2VyIGNvbmZpZw==")
.build());
}
}
resources:
example:
type: gcp:chronicle:Parser
properties:
location: us
instance: 00000000-0000-0000-0000-000000000000
logtype: WINDOWS_DHCP
validationSkipped: true
cbn: ZHVtbXkgcGFyc2VyIGNvbmZpZw==
Chronicle Parser Full
import * as pulumi from "@pulumi/pulumi";
import * as gcp from "@pulumi/gcp";
const example = new gcp.chronicle.Parser("example", {
location: "us",
instance: "00000000-0000-0000-0000-000000000000",
logtype: "LINUX_DHCP",
validatedOnEmptyLogs: false,
validationSkipped: true,
lowCode: {
log: "ZHVtbXkgbG9nIGJ5dGVz",
fieldExtractors: {
logFormat: "JSON",
appendRepeatedFields: true,
preprocessConfig: {
grokRegex: "(?P<message>.*)",
target: "message",
},
extractors: [
{
fieldPath: "$.ip",
destinationPath: "udm.principal.ip",
preconditionOp: "EQUALS",
preconditionPath: "$.event",
preconditionValue: "login",
},
{
destinationPath: "udm.metadata.product_name",
value: "Google",
},
],
},
},
versionInfo: {
autoUpgradeDisabled: false,
},
});
import pulumi
import pulumi_gcp as gcp
example = gcp.chronicle.Parser("example",
location="us",
instance="00000000-0000-0000-0000-000000000000",
logtype="LINUX_DHCP",
validated_on_empty_logs=False,
validation_skipped=True,
low_code={
"log": "ZHVtbXkgbG9nIGJ5dGVz",
"field_extractors": {
"log_format": "JSON",
"append_repeated_fields": True,
"preprocess_config": {
"grok_regex": "(?P<message>.*)",
"target": "message",
},
"extractors": [
{
"field_path": "$.ip",
"destination_path": "udm.principal.ip",
"precondition_op": "EQUALS",
"precondition_path": "$.event",
"precondition_value": "login",
},
{
"destination_path": "udm.metadata.product_name",
"value": "Google",
},
],
},
},
version_info={
"auto_upgrade_disabled": False,
})
using System.Collections.Generic;
using System.Linq;
using Pulumi;
using Gcp = Pulumi.Gcp;
return await Deployment.RunAsync(() =>
{
var example = new Gcp.Chronicle.Parser("example", new()
{
Location = "us",
Instance = "00000000-0000-0000-0000-000000000000",
Logtype = "LINUX_DHCP",
ValidatedOnEmptyLogs = false,
ValidationSkipped = true,
LowCode = new Gcp.Chronicle.Inputs.ParserLowCodeArgs
{
Log = "ZHVtbXkgbG9nIGJ5dGVz",
FieldExtractors = new Gcp.Chronicle.Inputs.ParserLowCodeFieldExtractorsArgs
{
LogFormat = "JSON",
AppendRepeatedFields = true,
PreprocessConfig = new Gcp.Chronicle.Inputs.ParserLowCodeFieldExtractorsPreprocessConfigArgs
{
GrokRegex = "(?P<message>.*)",
Target = "message",
},
Extractors = new[]
{
new Gcp.Chronicle.Inputs.ParserLowCodeFieldExtractorsExtractorArgs
{
FieldPath = "$.ip",
DestinationPath = "udm.principal.ip",
PreconditionOp = "EQUALS",
PreconditionPath = "$.event",
PreconditionValue = "login",
},
new Gcp.Chronicle.Inputs.ParserLowCodeFieldExtractorsExtractorArgs
{
DestinationPath = "udm.metadata.product_name",
Value = "Google",
},
},
},
},
VersionInfo = new Gcp.Chronicle.Inputs.ParserVersionInfoArgs
{
AutoUpgradeDisabled = false,
},
});
});
package main
import (
"github.com/pulumi/pulumi-gcp/sdk/v9/go/gcp/chronicle"
"github.com/pulumi/pulumi/sdk/v3/go/pulumi"
)
func main() {
pulumi.Run(func(ctx *pulumi.Context) error {
_, err := chronicle.NewParser(ctx, "example", &chronicle.ParserArgs{
Location: pulumi.String("us"),
Instance: pulumi.String("00000000-0000-0000-0000-000000000000"),
Logtype: pulumi.String("LINUX_DHCP"),
ValidatedOnEmptyLogs: pulumi.Bool(false),
ValidationSkipped: pulumi.Bool(true),
LowCode: &chronicle.ParserLowCodeArgs{
Log: pulumi.String("ZHVtbXkgbG9nIGJ5dGVz"),
FieldExtractors: &chronicle.ParserLowCodeFieldExtractorsArgs{
LogFormat: pulumi.String("JSON"),
AppendRepeatedFields: pulumi.Bool(true),
PreprocessConfig: &chronicle.ParserLowCodeFieldExtractorsPreprocessConfigArgs{
GrokRegex: pulumi.String("(?P<message>.*)"),
Target: pulumi.String("message"),
},
Extractors: chronicle.ParserLowCodeFieldExtractorsExtractorArray{
&chronicle.ParserLowCodeFieldExtractorsExtractorArgs{
FieldPath: pulumi.String("$.ip"),
DestinationPath: pulumi.String("udm.principal.ip"),
PreconditionOp: pulumi.String("EQUALS"),
PreconditionPath: pulumi.String("$.event"),
PreconditionValue: pulumi.String("login"),
},
&chronicle.ParserLowCodeFieldExtractorsExtractorArgs{
DestinationPath: pulumi.String("udm.metadata.product_name"),
Value: pulumi.String("Google"),
},
},
},
},
VersionInfo: &chronicle.ParserVersionInfoArgs{
AutoUpgradeDisabled: pulumi.Bool(false),
},
})
if err != nil {
return err
}
return nil
})
}
pulumi {
required_providers {
gcp = {
source = "pulumi/gcp"
}
}
}
resource "gcp_chronicle_parser" "example" {
location = "us"
instance = "00000000-0000-0000-0000-000000000000"
logtype = "LINUX_DHCP"
validated_on_empty_logs = false
validation_skipped = true
low_code = {
log = "ZHVtbXkgbG9nIGJ5dGVz"
field_extractors = {
log_format = "JSON"
append_repeated_fields = true
preprocess_config = {
grok_regex = "(?P<message>.*)"
target = "message"
}
extractors = [{
"fieldPath" = "$.ip"
"destinationPath" = "udm.principal.ip"
"preconditionOp" = "EQUALS"
"preconditionPath" = "$.event"
"preconditionValue" = "login"
}, {
"destinationPath" = "udm.metadata.product_name"
"value" = "Google"
}]
}
}
version_info = {
auto_upgrade_disabled = false
}
}
package generated_program;
import com.pulumi.Context;
import com.pulumi.Pulumi;
import com.pulumi.core.Output;
import com.pulumi.gcp.chronicle.Parser;
import com.pulumi.gcp.chronicle.ParserArgs;
import com.pulumi.gcp.chronicle.inputs.ParserLowCodeArgs;
import com.pulumi.gcp.chronicle.inputs.ParserLowCodeFieldExtractorsArgs;
import com.pulumi.gcp.chronicle.inputs.ParserLowCodeFieldExtractorsPreprocessConfigArgs;
import com.pulumi.gcp.chronicle.inputs.ParserLowCodeFieldExtractorsExtractorArgs;
import com.pulumi.gcp.chronicle.inputs.ParserVersionInfoArgs;
import java.util.ArrayList;
import java.util.Arrays;
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 example = new Parser("example", ParserArgs.builder()
.location("us")
.instance("00000000-0000-0000-0000-000000000000")
.logtype("LINUX_DHCP")
.validatedOnEmptyLogs(false)
.validationSkipped(true)
.lowCode(ParserLowCodeArgs.builder()
.log("ZHVtbXkgbG9nIGJ5dGVz")
.fieldExtractors(ParserLowCodeFieldExtractorsArgs.builder()
.logFormat("JSON")
.appendRepeatedFields(true)
.preprocessConfig(ParserLowCodeFieldExtractorsPreprocessConfigArgs.builder()
.grokRegex("(?P<message>.*)")
.target("message")
.build())
.extractors(
ParserLowCodeFieldExtractorsExtractorArgs.builder()
.fieldPath("$.ip")
.destinationPath("udm.principal.ip")
.preconditionOp("EQUALS")
.preconditionPath("$.event")
.preconditionValue("login")
.build(),
ParserLowCodeFieldExtractorsExtractorArgs.builder()
.destinationPath("udm.metadata.product_name")
.value("Google")
.build())
.build())
.build())
.versionInfo(ParserVersionInfoArgs.builder()
.autoUpgradeDisabled(false)
.build())
.build());
}
}
resources:
example:
type: gcp:chronicle:Parser
properties:
location: us
instance: 00000000-0000-0000-0000-000000000000
logtype: LINUX_DHCP
validatedOnEmptyLogs: false
validationSkipped: true
lowCode:
log: ZHVtbXkgbG9nIGJ5dGVz
fieldExtractors:
logFormat: JSON
appendRepeatedFields: true
preprocessConfig:
grokRegex: (?P<message>.*)
target: message
extractors:
- fieldPath: $.ip
destinationPath: udm.principal.ip
preconditionOp: EQUALS
preconditionPath: $.event
preconditionValue: login
- destinationPath: udm.metadata.product_name
value: Google
versionInfo:
autoUpgradeDisabled: false
Import
Parser can be imported using any of these accepted formats:
projects/{{project}}/locations/{{location}}/instances/{{instance}}/logTypes/{{logtype}}/parsers/{{parser}}{{project}}/{{location}}/{{instance}}/{{logtype}}/{{parser}}{{location}}/{{instance}}/{{logtype}}/{{parser}}
When using the pulumi import command, Parser can be imported using one of the formats above. For example:
$ pulumi import gcp:chronicle/parser:Parser default projects/{{project}}/locations/{{location}}/instances/{{instance}}/logTypes/{{logtype}}/parsers/{{parser}}
$ pulumi import gcp:chronicle/parser:Parser default {{project}}/{{location}}/{{instance}}/{{logtype}}/{{parser}}
$ pulumi import gcp:chronicle/parser:Parser default {{location}}/{{instance}}/{{logtype}}/{{parser}}
Constructors
- Parser(String name, {ParserArgs? args, CustomResourceOptions? options})
-
Creates a new Parser.
nameThe Pulumi resource name.argsArguments used to configure this Parser. The set of arguments for Parser.optionsResource options controlling this resource's behavior. - Parser.reference(String urn)
- Creates a typed reference to an existing Parser resource.
Properties
-
cbn
↔ Output<
String?> -
if the parser is built using config
documentation:
https://cloud.google.com/chronicle/docs/preview/parser-extensions/parsing-overview
latefinal
-
changelogs
↔ Output<
List< ParserChangelog> > -
Changelogs of a parser.
Structure is documented below.
latefinal
-
childResources
→ Set<
Resource> -
finalinherited
-
completionSources
↔ Map<
String, IOutputCompletionSource> -
latefinalinherited
-
createTime
↔ Output<
String> -
(Output)
Time at which changelog was created.
latefinal
-
creators
↔ Output<
List< ParserCreator> > -
Information about the creator of the parser.
Structure is documented below.
latefinal
-
deletionPolicy
↔ Output<
String> -
Whether Terraform will be prevented from destroying the resource. Defaults to DELETE.
When a 'terraform destroy' or 'pulumi up' would delete the resource,
the command will fail if this field is set to "PREVENT" in Terraform state.
When set to "ABANDON", the command will remove the resource from Terraform
management without updating or deleting the resource in the API.
When set to "DELETE", deleting the resource is allowed.
latefinal
-
dynamicParsingConfig
↔ Output<
String> -
Dynamic parsing config applied over the parser, if any.
latefinal
- hashCode → int
-
The hash code for this object.
no setterinherited
-
id
↔ Output<
String> -
getter/setter pairinherited
-
instance
↔ Output<
String> -
Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.latefinal - isCustom → bool
-
Returns whether this resource is provider-managed.
no setterinherited
- isProtected → bool
-
Returns whether this resource is protected from deletion.
no setterinherited
- isRemote → bool
-
Whether this resource is registered as remote.
no setterinherited
- isResourceReference → bool
-
Whether this instance represents a resource value returned over RPC.
finalinherited
-
location
↔ Output<
String> -
Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.latefinal -
logtype
↔ Output<
String> -
Resource ID segment making up resource
name. It identifies the resource within its parent collection as described in https://google.aip.dev/122.latefinal -
lowCode
↔ Output<
ParserLowCode?> -
Message to represent LowCodeParser.
Structure is documented below.
latefinal
-
name
↔ Output<
String> -
name of the parser resource.
latefinal
-
parser
↔ Output<
String> -
Output only. The server-generated ID of the parser.
latefinal
-
parserExtension
↔ Output<
String> -
Extension applied over the parser, if any.
latefinal
-
project
↔ Output<
String> -
The ID of the project in which the resource belongs.
If it is not provided, the provider project is used.
latefinal
-
releaseStage
↔ Output<
String> -
The release stage of the parser
After internal validations the prebuilt parser will directly start as
Release Candidate. The releaseStage of prebuilt parsers are changed
after every release cycle:
The prebuilt Release Candidate parser is promoted as Release parser.
The existing prebuilt Release parser is moved to Rollback state.
and existing prebuilt rollback parser is moved to Archived.
In case of custom parser:
When the customer submits a validation passed custom parser it starts as
Release state.
And existing one is moved to Rollback stage.
And the existing rollback is moved to Archived.
In case a release or release candidate parser is found faulty,
the parser is marked FAULTY,
if it is release parser then rollback candidate is moved to release.
Possible values:
RELEASE
RELEASE_CANDIDATE
ROLLBACK_CANDIDATE
ARCHIVED
FAULTY
ARCHIVED_IN_USE
latefinal
-
resourceTransforms
→ List<
ResourceTransform> -
Inherited/explicit async transforms.
no setterinherited
- runtimeType → Type
-
A representation of the runtime type of the object.
no setterinherited
-
state
↔ Output<
String> -
The state of the parser
Possible values:
ACTIVE
INACTIVE
latefinal
-
transformations
→ List<
ResourceTransformation> -
Inherited/explicit legacy transformations.
no setterinherited
-
type
↔ Output<
String> -
The type of the parser
Possible values:
CUSTOM
PREBUILT
latefinal
-
urn
↔ Output<
String> -
latefinalinherited
-
validatedOnEmptyLogs
↔ Output<
bool?> -
Flag to bypass parser validation when no logs are found.
If enabled, the parser won't be be rejected during the validation
phase when no logs are found.
latefinal
-
validationReport
↔ Output<
String> -
The Validation report generated during parser validation.
latefinal
-
validationSkipped
↔ Output<
bool?> -
If true, bypasses parser validation.
If enabled, the parser won't be rejected during the validation
phase and validation will be skipped.
latefinal
-
validationStage
↔ Output<
String> -
The validation stage of the parser
When a customer submits a new parser for validation, it starts with a
new stage.
When parser is picked for validation, it changes to Validation state.
If validation failed it is marked as failed, and
existing failed is moved to deleteCandidate stage.
If passes it is moved to passed stage.
If customer opts to submit it, the parser is moved to Release State.
Possible values:
NEW
VALIDATING
PASSED
FAILED
DELETE_CANDIDATE
INTERNAL_ERROR
VALIDATION_SKIPPED
latefinal
-
versionInfo
↔ Output<
ParserVersionInfo?> -
ParserVersionInfo gives the version information of the parser and related
properties like pinned etc.
Structure is documented below.
latefinal
Methods
-
failId(
Object error) → void -
Completes this resource ID with an error when registration fails.
inherited
-
failOutputs(
Object error) → void -
Completes all output properties with
error.inherited -
failUrn(
Object error) → void -
Completes this resource URN with an error when registration fails.
inherited
-
getProvider(
String moduleMember) → ProviderResource? -
Returns provider for
moduleMember's package, if configured.inherited -
getResourceName(
) → String -
Returns this resource's logical name.
inherited
-
getResourceType(
) → String -
Returns this resource's Pulumi type token.
inherited
-
noSuchMethod(
Invocation invocation) → dynamic -
Invoked when a nonexistent method or property is accessed.
inherited
-
registerOutput<
T> (String propertyName, {Object? decoder(Object?)?, bool isSecret = false}) → Output< T> -
Registers a dynamic output property for this resource.
inherited
-
resolveId(
String? value, {required bool isKnown}) → void -
Resolves the provider-assigned ID for this resource.
inherited
-
resolveOutputs(
Struct outputs) → void -
Resolves all output properties from a monitor response payload.
inherited
-
resolveUrn(
String value) → void -
Resolves this resource's URN once assigned by the engine.
inherited
-
serializeProperties(
Map< String, dynamic> properties) → Future<Struct> -
Serializes resource properties for RPC transmission.
inherited
-
toString(
) → String -
A string representation of this object.
inherited
Operators
-
operator ==(
Object other) → bool -
The equality operator.
inherited