An open API service indexing awesome lists of open source software.

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

Awesome Lists containing this project

README

          

# πŸ“ iRule-Validator

![Static Badge](https://img.shields.io/badge/build-passing-elk)
![GitHub Release](https://img.shields.io/github/v/release/elkrammer/irule-validator)
![Static Badge](https://img.shields.io/badge/license-MIT-blue?)

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.

![irule-validator](https://github.com/user-attachments/assets/6fdf255e-aa6e-4d73-972e-18ad3e700502)

## πŸš€ Usage

```bash
Usage of ./irule-validator:
-d, --debug Debugging Mode
-h, --help Show help message
-p, --print-errors Print Errors

If 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! πŸ’₯