https://github.com/elkrammer/irule-validator
F5 IRule Parser / Validator
https://github.com/elkrammer/irule-validator
bigip f5 f5-bigip f5networks irule irules parser validator
Last synced: 8 months ago
JSON representation
F5 IRule Parser / Validator
- Host: GitHub
- URL: https://github.com/elkrammer/irule-validator
- Owner: elkrammer
- License: mit
- Created: 2024-01-14T13:21:52.000Z (over 1 year ago)
- Default Branch: main
- Last Pushed: 2025-02-10T14:08:51.000Z (8 months ago)
- Last Synced: 2025-02-10T14:28:11.157Z (8 months ago)
- Topics: bigip, f5, f5-bigip, f5networks, irule, irules, parser, validator
- Language: Go
- Homepage:
- Size: 188 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
- awesome-f5 - irule-validator - A Go-based parser and validator for iRules. (DevOps / CICD)
README
# π iRule-Validator


Ever written an F5 iRule and thought "this should work!"βonly to get hit with
an "Invalid expression on line 42"?Deploying an iRule, waiting for automation to kick in, and then realizing itβs
broken is frustrating. Wouldn't it be great to catch those errors before they
waste your time?You're in luck! This project lets you parse F5 iRules, catch syntax errors early,
and debug with confidence.
## π Usage
```bash
Usage of ./irule-validator:
-d, --debug Debugging Mode
-h, --help Show help message
-p, --print-errors Print ErrorsIf no parameter is specified it will run in quiet mode returning only
the result.
If a file name is specified, it will parse the provided file.
If no file name is specified, it will go into REPL mode.Examples:
./irule-validator http.irule # Parse http.irule and show only the result
./irule-validator -p http.irule # Parse http.irule and print errors
./irule-validator # Start REPL
```When using this in a CI/CD pipeline, be sure to call it with `-p` to get
those sweet error printouts you so desperately crave. π€€## π οΈ Features
- Parse and validate various iRule-specific constructs
- Static Syntax Analysis
- Glob and regex pattern validation
- Symbol table to prevent incompatible command combinations
- Detailed error reporting with line numbers
- Debug mode for detailed parsing information## π¦ Disclaimer
Does it validate every possible command with perfect accuracy? Not quite.
Full syntax validation is *hard*, and F5 iRules are a bottomless pit
of edge cases. π³οΈBuilding a complete F5 iRule parser is like trying to solve a puzzle where
the pieces keep changing shape. But hey, I already have a parser that
covers most of the use cases I need and that's good enough for me! π## π§ Contributing
PRs are welcome! π₯