The updateParserV2() GraphQL mutation may be used to update a parser. Only the provided fields are updated on the parser. The fields that aren't provided are unchanged.

For more information on parsers, see the Parsing Data documentation page.

Syntax

Below is the syntax for the updateParserV2() mutation field:

graphql
updateParserV2(
     input: UpdateParserInputV2!
   ): Parser!

Given Datatypes

For the given datatype, UpdateParserInputV2, there are several parameters that may be given. Below is a list of them along with their datatypes and a description of each:

Table: UpdateParserInputV2

ParameterTypeRequired[a]DefaultDescription
repositoryNameRepoOrViewNameyes The repository where the parser is located. This is a scalar.
idstringyes The unique identifier of the parser to update.
namestring  The name to use for the parser.
scriptUpdateParserScriptInput  Input for updating the parser script. See UpdateParserScriptInput Table.
testData[string]yes Test events that can be parsed by the parser.
testCases[ParserTestCaseInput]yes Test cases that can be used to help verify that the parser works as expected. See ParserTestCaseInput Table.
fieldsToTag[string]  Fields that are used as tags.
fieldsToBeRemovedBeforeParsing[string]yes A list of fields that will be removed from the event before it's parsed. These fields will not be included when calculating usage.

[a] Some arguments may be required, as indicated in this column. For some fields, this column indicates that a result will always be returned for it.


Returned Datatypes

The returned datatype Parser has its own parameters. Below is a list of them along with their datatypes and a description of each:

Table: Parser

ParameterTypeRequired[a]DefaultDescription
idstringyes The unique identifier of the parser.
namestringyes The name of the parser.
displayNamestringyes The full name of the parser, including package information if part of an application.
isBuiltInbooleanyes True if the parser is one of LogScale's built-in parsers.
sourceCodestringyes The source code of the parser. This field is deprecated and will be replaced with script starting with version 1.142.
languageVersionLanguageVersionyes The language version used by the parser (see LanguageVersion Table).
tagFields[string]yes The fields to use as tags. This field is deprecated and will be replaced with fieldsToTag starting with version 1.142.
yamlTemplateYAMLyes A template that can be used to recreate the parser.
testData[string]yes Saved test data (e.g. log lines) that you can use to test the parser. This field is deprecated and will be replaced with testCases starting with version 1.142.
packagePackageInstallation  The package associated with the parser, if any. See PackageInstallation Table.
descriptionstring  A description of the parser.
assetTypeAssetTypeyes The type of asset (see AssetType Table). This enumerated datatype has been deprecated and will be removed in version 1.136 of LogScale.

[a] Some arguments may be required, as indicated in this column. For some fields, this column indicates that a result will always be returned for it.