The testParser() GraphQL mutation is used to test a parser on some test events in LogScale. If the parser fails to run, an error is returned. Otherwise, a list of results, one for each test event, is returned.

This is deprecated and will be removed in version 1.142. Use instead testParserV2().

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

Syntax

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

graphql
testParser(
     input: TestParserInputV2!
   ): TestParserResultV2!

Given Datatypes

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

Table: TestParserInputV2

ParameterTypeRequired[a]DefaultDescription
repositoryNamestringyes The name of the repository in which the parser is located.
parserIdstringyes The unique identifier of the parser.
parserNamestringyes The name of the parser
parserScriptstringyes The parser script to be tested.
testData[string]yes The events on which to test the parser.

[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, TestParserResultV2 is a union between two other datatypes: TestParserSuccessResultV2 and TestParserErrorResult. The parameters for those are listed in the tables below:

Table: TestParserSuccessResultV2

ParameterTypeRequired[a]DefaultDescription
resultsstringyes The results of parsing the test events.

[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.


Table: TestParserErrorResult

ParameterTypeRequired[a]DefaultDescription
errorMessagestringyes An error message while running a parser and no events were parsed.

[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.