Skip to content

How to configure diff exclusions in rConfig V8 Core

Every configuration backup captures a snapshot in time, but not everything in that snapshot matters for change tracking. Timestamps change with every backup, uptime counters increment constantly, session IDs are ephemeral, and certificate renewal dates shift. After reading this page you can configure Compare Options and write regex-based diff exclusions that filter this noise out of your configuration diffs.

Use diff exclusions when your configuration diffs show changes every backup cycle even though nothing meaningful changed. This is common on devices that report uptime, session IDs, packet counters, or certificate data in their running configuration. Set up exclusions once and every future diff benefits.

  • At least one device with configuration backups running, so you have diffs to compare against
  • Access to Compare Options under Inventory → Commands
  • A sample diff showing the noise you want to exclude, so you can identify the pattern to match

You run daily backups of your core routers. Yesterday’s config and today’s config show 47 differences, but when you review the diff:

  • 20 differences are timestamp updates
  • 15 are uptime counter changes
  • 8 are interface packet counters
  • 3 are session IDs
  • 1 is an actual ACL modification

You spent ten minutes finding the one real change buried in 46 false positives. Multiply this across hundreds of devices and diff noise becomes a serious operational burden. Diff exclusions remove that waste by hiding the dynamic content so only real changes surface.

rConfig V8 Core stores a single set of comparison options plus a global exclusion file that are applied to every config comparison. Two settings work together: the comparison options below control how the diff engine behaves, and the exclusion file (covered in the walkthrough) controls which content is ignored.

OptionPurposeExample use case
Compare ExclusionsExclude specific lines or patterns using regexIgnore ! Last configuration change at 12:34:56 timestamps
Compare ContextShow N lines before and after each differenceShow 3 lines of context around changes for readability
Length LimitLimit the number of characters comparedCap comparison of very large command output
Ignore CaseCase-insensitive comparisonTreat Router and router as identical
Ignore Line EndingIgnore CR/LF differencesHandle configs from Windows, Linux, and Unix systems
Ignore WhitespaceIgnore spaces, tabs, and indentationIgnore formatting differences, focus on content

Diff exclusions use regex patterns to identify content that should be ignored during comparison. Follow these steps to open Compare Options and write your first exclusion file.

  1. Navigate to Inventory → Commands and click Compare Options. Alternatively, from a stored diff (the Config Changes panel on a config), click Open Compare Options.

  2. Open the Compare Exclusions field. This is where the exclusion file content is entered.

  3. Start the file with a description line, a method block, and your regex patterns, using this structure:

    // Description of what this exclusion does
    #[global]
    /regex pattern one/
    /regex pattern two/
    // Description of command-specific exclusion
    #[command-name]
    /command-specific pattern/
    • A description line (// followed by text) explains what the exclusion does.
    • A method block (#[method-name]) defines the scope. The first block must be #[global].
    • Regex patterns sit one per line, including delimiters (/pattern/) and any flags (/pattern/i, /pattern/ms).
  4. Add a #[global] block first for content that is dynamic across every device, such as timestamps and session IDs. This block applies to all command output on all devices.

    // Exclude all timestamp variations
    #[global]
    /^! Last configuration change at.*$/
    /^! NVRAM config last updated at.*$/
    /^Building configuration.*$/
  5. Add #[command-name] blocks below it for noise that is specific to one command. Match the command name to the Commands table exactly: if the command is stored as show run, use #[show run].

    // Exclude uptime from show version
    #[show version]
    /^.*uptime is.*$/
    /^System restarted at.*$/
    /^System image file is.*$/
  6. Validate each pattern at regex101.com before saving: set the flavor to PCRE (PHP), paste a sample of the command output, and confirm the pattern matches only what you intend.

  7. Save the Compare Options. The exclusions apply to every future config comparison.

Single-line patterns are processed line by line. They are ideal for filtering individual lines of dynamic content.

// Exclude session details from show run
#[show run]
/^! Session ID:.*$/
/^Current configuration : \d+ bytes$/
// Exclude packet and error counters
#[show interfaces]
/^\s+\d+ packets input, \d+ bytes.*$/
/^\s+\d+ packets output, \d+ bytes.*$/
/^\s+\d+ input errors.*$/

Multiline patterns handle content spanning multiple lines, such as certificate blocks and configuration sections. They require special regex flags.

  • s (dotall): allows . to match newline characters. Essential for patterns crossing line boundaries.
  • m (multiline): makes ^ and $ match the start and end of any line, not just the whole string.
  • ms (combined): most multiline exclusions need both.

Certificates span many lines and change when renewed. Use non-greedy matching (.*?) to stop at the first closing tag.

// Exclude certificate text from show run
#[show run]
/^crypto pki certificate.*?-----END CERTIFICATE-----"$/ms
// Exclude public keys
#[show run]
/^ssh-rsa AAAA.*?==.*$/ms
// Exclude interface configuration blocks
#[show run]
/^interface .*?^!/ms

Pattern explanation for /^interface .*?^!/ms:

  • ^interface matches the start of a line matching “interface”
  • .*? is a non-greedy match of any content (including newlines via the s flag)
  • ^! stops at a line starting with ! (Cisco section delimiter)
  • /ms applies the multiline and dotall flags

A practical exclusion configuration for Cisco IOS devices:

// Global exclusions for all commands
#[global]
/^! Last configuration change at.*$/
/^! NVRAM config last updated at.*$/
/^ntp clock-period \d+$/
/^.*uptime is.*$/
// Show run specific exclusions
#[show run]
/^Building configuration.*$/
/^Current configuration : \d+ bytes$/
/^crypto pki certificate.*?-----END CERTIFICATE-----"$/ms
/^interface .*?^!/ms
  • Start broad, then refine. Begin with global exclusions for universal noise such as timestamps, then add command-specific exclusions as you identify patterns unique to certain commands.
  • Test patterns before deployment. Validate every pattern at regex101.com with the PCRE (PHP) flavor against a real sample of command output.
  • Use non-greedy matching for multiline. Always use .*? rather than .* in multiline patterns, or a single pattern can swallow multiple config blocks at once.
  • Be specific, not overly broad. /^! Last configuration change at.*$/ matches only that timestamp line, whereas /interface/ matches any line containing the word and will hide real changes.
  • Verify the command name matches the Commands table exactly (case-sensitive).
  • Check the regex syntax: delimiters present (/pattern/), correct flags (/pattern/ms), special characters escaped (\.).
  • Test the pattern in isolation on regex101.com with the PCRE (PHP) flavor.
  • Confirm #[global] is the first block.

If important changes are being hidden, the pattern is too broad. Add anchors and context, for example use /^interface Loopback\d+$/m instead of /interface/. If a multiline pattern is not matching, add the s flag so . matches newlines, use non-greedy .*?, and ensure ^ and $ have the m flag.

FlagNamePurposeExample
sDotall. matches newlines/pattern.*content/s
mMultiline^ and $ match line boundaries/^interface.*$/m
iCase-insensitiveIgnore case/router/i
msCombinedBoth multiline and dotall/^block.*?^!/ms

Never use the g flag in rConfig exclusions.