rConfig - Device Configuration Property Parsing
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
- 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). - UI Integration: Newly created properties are accessible through the Device Details panel or the Configuration Properties table for management.
- Real-time Testing: You can test the functionality of a Configuration Property directly within rConfig.
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.
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.
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.
Example Regex Patterns
For inspiration, below are tested examples for extracting values from a Cisco show run
configuration:
Example 1: Extract Hostname
- Description: Extracts the device hostname.
- Example Result:
router1
Example 2: Extract First IP Address
- Description: Extracts the first IP address.
- Example Result:
192.168.50.10
Example 3: Extract SNMP Community String
- Description: Extracts the SNMP community string.
- Example Result:
public
Example 4: Extract NTP Server Address
- Description: Extracts the NTP server address.
- Example Result:
ie.pool.ntp.org
Example 5: Extract Version
- Description: Extracts the software version.
- Example Result:
15.7
Example 6: Extract Loopback Interfaces
- Description: Extracts all loopback interfaces.
- Example Results:
Loopback0
,Loopback1
,Loopback30
Additional Examples
Extract Crypto Key
- Example Result:
trustpoint
Extract Domain Name
- Example Result:
rconfigdev.com
Extract Enable Secret
- Example Result:
$1$PYMP$ShFY8kvekfirjMFGsPnRZ0
Extract IP Name Servers
- Example Results:
8.8.8.8
,1.1.1.1
,3.3.3.3
,4.4.4.4
Extract BGP Networks
- Example Results:
1.1.1.1
,2.2.2.2
,5.5.5.5
,6.6.6.6
Extract System Image File
- Example Result:
bootflash:packages.conf
Extract Configuration Register
- Example Result:
0x2102
Extract License Level
- Example Result:
ax
Extract Memory Details
- Example Result:
3984840K bytes of physical memory
Extract Processor Board ID
- Example Result:
9FM4W37HHOV
Debugging and Testing
If a newly created Configuration Property is not working as expected:
- Ensure the regular expression is valid using the Config Property Test feature.
- Review configuration outputs to confirm the pattern matches.
- Use the debug command for troubleshooting.
- 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.