The CreateParserInputV2 is the input for creating a parser. It includes various settings.

Table: CreateParserInputV2

ParameterTypeRequired[a]DefaultDescription
namestringyes The name to use for the parser.
scriptstringyes The parser script that is executed for every incoming event.
testCases[ParserTestCaseInput]yes Test cases that can be used to help verify that the parser works as expected. See ParserTestCaseInput Table.
repositoryNameRepoOrViewNameyes The repository where the parser is located. This is a scalar.
fieldsToTag[string]yes 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.
allowOverwritingExistingParserboolean  Allows saving a parser with a name that is already in use, by overwriting the parser that previously had the name.
languageVersionLanguageVersionInputType = {name: 'legacy'}  A specific language version. See LanguageVersionInputType Table.

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