Text Parser is used to match specified lines of text. For example, to verify and make sure certain configuration or CLI command output keeps no change in the future, users can define a text parser to parse specified lines of text and further compare live data with baseline.
Applicable parser rule for Text Parser: Start/End Line
Use a text parser when you only want to use a portion of configuration file or CLI command outputs to validate network design and check change.
Take the parsing of configuration file for example. You can define a text parser to parse configuration file.
1.Retrieve sample text of configurations.
2.Select a parser type by clicking Add Text to add a variable Text1.
4.Preview the parsed result of sample text, and then click OK to save the text parser.
The system adopts exact match to compare the selected lines of text when applying a text parser, following these rules:
1.Text lines are order-sensitive for line-by-line matching, regardless of whether a line is consecutive with others.
2.When a few text lines can match but others cannot, only the matching lines are added to the parsed result.
3.When there are multiple matches for one line, the first matching line will be adopted and added to the parsed result.
For example, to check whether the AAA configurations have changed, you can define a text variable named “aaa_config”, and add the relevant lines of text (9 lines) in the sample configuration file as the content to match.
When the system applies this text parser to parse the retrieved configurations from a live network, it uses the value of the predefined text variable (9 lines of text) to match the live data. In the following example, only 7 lines can be exactly matched, which indicates the AAA configurations have been changed.