10.1.15.12-06212024
Create a Configuration Parser
This section introduces how to create a Configuration Parser to extract key metrics from the configuration files of devices.
Example: Parse the version number of a device in its configuration file.
- Go to Parser Library, then click New Advanced Parser from the drop-down menu of a folder. The parser editor will open.
- Keep the default Traditional Devices node type and select Cisco Router from the Device Type list.
Tip: The system also supports defining a Parser to retrieve and parse SDN data through APIs. See Creating an API Parser to get details about API Parser.
- (Optional): Click Advanced to configure the settings for filtering applicable devices as qualified device. For more information, see Qualified Device Filter in Advanced Parser.
- Select Configuration from the Data Type dropdown menu.
- Select the data source (Live Network/Current Baseline) to obtain the sample configuration file.
- Live Network: Retrieve live network data.
- Current Baseline: Use the current baseline data.
- Click Retrieve and select a device (e.g., US-BOS-R1) to retrieve sample data.
- Highlight the version number in the sample data and click Define Keyword in the floating menu. The Keyword Parser dialog prompts with the following fields auto-populated.
- Sample — the sample command line where the variable stays.
- Parser — defines keywords and where a variable is located. The Keyword line pattern Version $var1$,is created automatically. It contains the keywords Version that always stay the same and the variable $var1, which varies in different devices.
- Variable — the variable defined in the Parser. To change the auto-created variable name to a more meaningful name, rename the variable, such as from var1 to Version.
- Click Save Variable in the Keyword Parser dialog. This variable will be displayed in the variable tree.
- Click the
icon the save the Parser in the Parser Library.
See also: