> For clean Markdown of any page, append .md to the page URL.
> For a complete documentation index, see https://docs.itential.com/llms.txt.
> For AI client integration (Claude Code, Cursor, etc.), connect to the MCP server at https://docs.itential.com/_mcp/server.

# Use configuration parsers

Configuration parsers define syntax rules for CLI Golden Configuration. Use them to ensure Configuration Manager correctly interprets device configurations for compliance checking.

## What are configuration parsers?

Configuration parsers specify how Configuration Manager should read and compare CLI configurations. They define the syntax rules, command structure, and comparison logic for specific device operating systems.

## Why parsers matter

Different network operating systems use different CLI syntax:

* **Cisco IOS**: Hierarchical with indentation
* **Juniper Junos**: XML-like with braces
* **Arista EOS**: Similar to Cisco with variations
* **Palo Alto**: Set-based commands

Parsers ensure Configuration Manager handles each syntax correctly during compliance checks.

## Available parsers

Configuration Manager includes pre-built parsers for common platforms:

| Parser         | Operating System | Vendor             |
| -------------- | ---------------- | ------------------ |
| cisco-ios      | IOS and IOS-XE   | Cisco              |
| cisco-nxos     | NX-OS            | Cisco              |
| cisco-iosxr    | IOS-XR           | Cisco              |
| juniper-junos  | Junos OS         | Juniper            |
| arista-eos     | EOS              | Arista             |
| paloalto-panos | PAN-OS           | Palo Alto Networks |

## How parsers work

Parsers process configurations through these steps:

#### Tokenize

Break configuration text into commands and parameters

#### Parse structure

Identify hierarchical relationships and command blocks

#### Normalize

Convert to standardized format for comparison

#### Compare

Match device configuration against golden configuration

#### Report differences

Identify and highlight non-compliant sections

## Select a parser

Choose a parser when creating a CLI golden configuration.

To select a parser:

#### Create golden configuration

Click **Create (+)** and select **Golden Configuration**

#### Choose CLI type

Select **CLI** as the configuration type

#### Select parser

Choose the parser that matches your device OS

#### Create

Click **Create** to use the selected parser

The parser cannot be changed after creating a golden configuration. Choose carefully based on your device OS type.

## Parser behavior

### Cisco IOS parser

**Syntax characteristics:**

* Hierarchical indentation
* Exclamation marks for comments
* "no" prefix to negate commands

**Example:**

```
interface GigabitEthernet0/1
 description Uplink
 ip address 10.0.1.1 255.255.255.0
 no shutdown
!
router ospf 100
 network 10.0.0.0 0.0.255.255 area 0
```

**Parser behavior:**

* Recognizes indentation-based hierarchy
* Treats "!" as section delimiter
* Handles "no" command negation
* Normalizes whitespace

### Juniper Junos parser

**Syntax characteristics:**

* Brace-based hierarchy
* Semicolon statement terminators
* Set command format

**Example:**

```
interfaces {
    ge-0/0/1 {
        description "Uplink";
        unit 0 {
            family inet {
                address 10.0.1.1/24;
            }
        }
    }
}
```

**Parser behavior:**

* Recognizes brace hierarchy
* Handles semicolon delimiters
* Supports set command format
* Normalizes brace placement

### Arista EOS parser

**Syntax characteristics:**

* Similar to Cisco IOS
* Additional EOS-specific commands
* YAML-like structures for some features

**Example:**

```
interface Ethernet1
   description Uplink
   no switchport
   ip address 10.0.1.1/24
!
router ospf 100
   network 10.0.0.0/16 area 0.0.0.0
```

**Parser behavior:**

* Handles IOS-like syntax
* Recognizes EOS extensions
* Supports CIDR notation
* Normalizes command variations

## Parser comparison rules

Parsers apply these rules during compliance checks:

### Whitespace handling

Parsers normalize whitespace:

* Leading and trailing spaces ignored
* Multiple spaces treated as single space
* Tab characters converted to spaces

**Example:**

```
# These are equivalent:
ip address  10.0.1.1   255.255.255.0
ip address 10.0.1.1 255.255.255.0
```

### Comment handling

Comments are typically ignored:

* Cisco: Lines starting with "!"
* Juniper: Lines with "/*" and "*/"
* Configuration comments don't affect compliance

**Example:**

```
# These are equivalent:
! Production interface
interface GigabitEthernet0/1

interface GigabitEthernet0/1
```

### Command ordering

Most parsers treat unordered commands as equivalent:

* Commands at same hierarchy level
* Order doesn't affect compliance
* Exception: Ordered sections with CLI ordering markers

### Case sensitivity

Parser case handling varies:

* Commands: Usually case-insensitive
* Values: May be case-sensitive
* Check parser documentation for specifics

## Customize parser behavior

### Configure parser options

Some parsers support configuration options:

#### Open Configuration Manager settings

Navigate to Admin Essentials

#### Select Configuration Manager

Open Configuration Manager settings

#### Configure parser options

* Set comparison strictness
* Define custom ignore patterns
* Configure normalization rules

#### Save settings

Apply parser configuration

### Ignore patterns

Configure patterns to exclude from compliance:

**Examples:**

```
# Ignore timestamp comments
pattern: ^! Last modification:

# Ignore system-generated names
pattern: ^crypto key.*

# Ignore version banners
pattern: ^banner motd
```

## Troubleshoot parser issues

### Compliance fails unexpectedly

If compliance fails despite matching configurations:

#### Check parser selection

Verify correct parser for device OS

#### Review syntax

Ensure golden config uses correct syntax

#### Test normalization

Check if whitespace or comments cause issues

#### Validate structure

Confirm hierarchical structure matches parser expectations

### Parser errors

If parser reports errors:

#### Validate syntax

Check configuration for syntax errors

#### Check special characters

Verify quotes, braces, and delimiters are correct

#### Review indentation

Ensure proper indentation for hierarchical parsers

#### Test with simple config

Isolate problem by testing with minimal configuration

## Best practices

**Choose the right parser:**

* Match parser to device OS exactly
* Don't use cisco-ios parser for cisco-nxos
* Test parser with sample configurations
* Verify parser handles your command set

**Write clean configurations:**

* Use consistent indentation
* Add clear comments for documentation
* Follow vendor syntax guidelines
* Avoid vendor-specific shortcuts

**Test thoroughly:**

* Validate golden configs with parser
* Test compliance with known-good devices
* Verify parser handles edge cases
* Check for false positives/negatives

**Handle parser limitations:**

* Document unsupported commands
* Use custom ignore patterns for exceptions
* Consider alternative comparison methods for complex cases
* Report parser issues to Itential support

## Next steps

#### [CLI Golden Configuration](./cli)

Create CLI Golden Configuration

#### [CLI ordering](./cli-ordered-lists)

Handle ordered configuration lists