API Stability |
Long-Term
|
The cloneParser() GraphQL mutation may be used to clone a parser.
For more information on parsers, see the Parsing Data documentation page.
Syntax
Below is the syntax for the cloneParser() mutation field:
graphql
cloneParser(
input: CloneParserInput!
): Parser!
Below is an example of how this mutation field might be used:
graphql
mutation {
cloneParser(input:
{ newParserName: "parser-and-sage",
repositoryName: "sandbox",
parserIdToClone: "ZL7oe0xwOwwVEUx4CGd7NWPGER3nFB8n"} )
{ id, name }
}
json
{
"data": {
"cloneParser": {
"id": "6UeuJ808HWB8Dszc0PQkYow04tjr2re1",
"name": "parser-and-sage"
}
}
}
Given Datatypes
For CloneParserInput
,
there are a few parameters. Below is a list of them along with a
description of each:
Table: CloneParserInput
Parameter | Type | Required | Default | Stability | Description |
---|---|---|---|---|---|
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column. | |||||
Table last updated: Sep 17, 2024 | |||||
newParserName | string | yes | Long-Term | Name of the new parser. | |
parserIdToClone | string | yes | Long-Term | Unique identifier of the parser to clone. | |
repositoryName | string | yes | Long-Term | Name of the repository. |
Returned Datatypes
The returned datatype parser
has several
parameters. Below is a list of them along with a description of
each:
Table: Parser
Parameter | Type | Required | Default | Stability | Description |
---|---|---|---|---|---|
Some arguments may be required, as indicated in the Required column. For some fields, this column indicates that a result will always be returned for this column. | |||||
Table last updated: Mar 26, 2025 | |||||
assetType | AssetType | yes | Long-Term | The type of asset. See AssetType . This is deprecated and will be removed in LogScale 1.142. | |
description | string | Long-Term | A description of the parser. | ||
displayName | string | yes | Long-Term | The full name of the parser, including package information if part of an application. | |
fieldsToBeRemovedBeforeParsing | [string] | yes | Long-Term | A list of fields that will be removed from the event before it's parsed. These fields will not be included when calculating usage. | |
fieldsToTag | [string] | yes | Long-Term | The fields that are used as tags. | |
id | string | yes | Long-Term | The unique identifier of the parser. | |
isBuiltIn | boolean | yes | Long-Term | True if the parser is one of LogScale's built-in parsers. | |
languageVersion | LanguageVersion | yes | Long-Term | The language version used by the parser. See LanguageVersion . | |
name | string | yes | Long-Term | The name of the parser. | |
script | string | yes | Long-Term | The parser script that is executed for every incoming event. | |
sourceCode | string | yes | Long-Term | The source code of the parser. This is deprecated and will be replaced with script starting in version 1.142. | |
tagFields | [string] | yes | Long-Term | The fields to use as tags. This is deprecated and will be replaced with fieldsToTag starting in version 1.142. | |
testCases | [ParserTestCase ] | yes | Long-Term | Test cases that can be used to help verify that the parser works as expected. See ParserTestCase . | |
testData | [string] | yes | Long-Term | Saved test data (e.g., log lines) that you can use to test the parser. This is deprecated and will be replaced with testCases starting with version 1.142. | |
package | PackageInstallation | Long-Term | The package associated with the parser, if any. See PackageInstallation . | ||
packageId | VersionedPackageSpecifier | Long-Term | The identifier of the package used, if one. VersionedPackageSpecifier is a scalar. | ||
yamlTemplate | yaml | yes | Long-Term | A template that can be used to recreate the parser. |