Skip to content

rConfig - Device Configuration Property Parsing

7 mins V7 Pro

Configuration Property Extraction is a feature in rConfig that allows you to extract specific values from full device configuration outputs using regular expressions. Like SNMP properties, these extracted properties are displayed in the Device View page and included in Inventory Reports. These properties are parsed and extracted every time a configuration backup or download occurs for a device.

Key Features

  1. Explicit Command Linkage: Configuration Properties are directly linked to rConfig commands, meaning the extraction process occurs each time the associated command is executed (e.g., a show run command).
  2. UI Integration: Newly created properties are accessible through the Device Details panel or the Configuration Properties table for management.
  3. Real-time Testing: You can test the functionality of a Configuration Property directly within rConfig.

Screenshot showing Configuration Properties section

Steps to Set Up Configuration Property Extraction

Step 1: Access Configuration Properties

  • Navigate to the Commands section.
  • Click the Configuration Properties button located at the top-right of the table.
  • Alternatively, you can access Configuration Properties from the Device Details panel.

Screenshot showing navigation to Configuration Properties

Screenshot showing navigation to Configuration Properties

Step 2: Create a New Configuration Property

  • Open the Configuration Properties table and click New Configuration Property.
  • Fill in the required fields:
    • Property Name: Provide a memorable name.
    • Regex Pattern: Enter the full regular expression pattern, including delimiters and any switches.
    • Command: Select the rConfig command this property will be linked to.

Step 3: Test the Configuration Property

  • Open any configuration output for the selected command.
  • Click the Config Property Test button.
  • Select the Configuration Property to test and run it against the selected configuration output.
  • Validate the results to ensure your regex works as expected.

Tip: Use online tools like regex101.com for advanced regex validation before implementing. Gen AI tools like can also help solve advanced Regular Expressions.

Screenshot showing Configuration Property test popup

Final Result

After setting up Configuration Properties, you can view the extracted values in the Device Details panel. These properties are also included in Inventory Reports for detailed analysis and auditing.

Screenshot showing Device Details panel with Configuration Properties

Example Regex Patterns

For inspiration, below are tested examples for extracting values from a Cisco show run configuration:

Example 1: Extract Hostname

/^hostname\s+(\S+)/m
  • Description: Extracts the device hostname.
  • Example Result: router1

Example 2: Extract First IP Address

/ip address\s+(\d+\.\d+\.\d+\.\d+)/
  • Description: Extracts the first IP address.
  • Example Result: 192.168.50.10

Example 3: Extract SNMP Community String

/^snmp-server community\s+(\S+)/m
  • Description: Extracts the SNMP community string.
  • Example Result: public

Example 4: Extract NTP Server Address

/^ntp server\s+(\S+)/m
  • Description: Extracts the NTP server address.
  • Example Result: ie.pool.ntp.org

Example 5: Extract Version

/^version\s+(\S+)/m
  • Description: Extracts the software version.
  • Example Result: 15.7

Example 6: Extract Loopback Interfaces

/^interface Loopback(\d+)/m
  • Description: Extracts all loopback interfaces.
  • Example Results: Loopback0, Loopback1, Loopback30

Additional Examples

Extract Crypto Key

/^crypto pki\s+(\S+)/m
  • Example Result: trustpoint

Extract Domain Name

/^ip domain name\s+(\S+)/m
  • Example Result: rconfigdev.com

Extract Enable Secret

/^enable secret 5 (.+)$/m
  • Example Result: $1$PYMP$ShFY8kvekfirjMFGsPnRZ0

Extract IP Name Servers

/^ip name-server\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/m
  • Example Results: 8.8.8.8, 1.1.1.1, 3.3.3.3, 4.4.4.4

Extract BGP Networks

/^\s*network\s+(\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3})/m
  • Example Results: 1.1.1.1, 2.2.2.2, 5.5.5.5, 6.6.6.6

Extract System Image File

/System image file is "([^"]+)"/
  • Example Result: bootflash:packages.conf

Extract Configuration Register

/Configuration register is (\S+)/
  • Example Result: 0x2102

Extract License Level

/License Level:\s+(\S+)/
  • Example Result: ax

Extract Memory Details

/(\d+K bytes of physical memory)/
  • Example Result: 3984840K bytes of physical memory

Extract Processor Board ID

/Processor board ID (\S+)/
  • Example Result: 9FM4W37HHOV

Debugging and Testing

If a newly created Configuration Property is not working as expected:

  1. Ensure the regular expression is valid using the Config Property Test feature.
  2. Review configuration outputs to confirm the pattern matches.
  3. Use the debug command for troubleshooting.
  4. Validate patterns using online tools such as regex101.

Additional Tips

  • Efficiency: Test your regex with sample configurations before implementation.
  • Scalability: Design regex patterns to accommodate variations in device configurations.
  • Documentation: Keep a record of tested regex patterns for reuse.

Conclusion

Configuration Property Extraction adds flexibility and precision to rConfig by enabling custom data parsing directly from device configurations. With tools for real-time testing and robust regex support, this feature ensures accurate data retrieval for enhanced device management.