An iRule is an event-driven script written in a F5-customized Tcl binary (based on version 8.4.6) that allows you to customize traffic handling on a F5 BIG-IP system. iRules give you the flexibility to inspect, manipulate, and route traffic at a granular level—allowing you to enhance security, optimize performance, and implement advanced logic within your application delivery infrastructure. Whether you’re looking to redirect requests, modify headers, or enforce security policies, iRules are a great expansion of tools for your toolbox.
Popular Use Cases for iRules
- HTTP Manipulation – Modify request/response headers, rewrite URLs, insert cookies.
- Traffic Redirection – Redirect users based on geolocation, time of day, or client attributes.
- Security & Access Control – Block malicious traffic, enforce authentication, detect anomalies.
- Logging & Monitoring – Capture detailed traffic insights for analysis.
- Application Performance Optimization – Implement caching logic, delay responses, or balance load dynamically.
New to iRules? Start with our Getting Started with iRules series to understand the basics.
Level Up Your iRules Skills
- Read Articles – all iRules tagged articles
- Intermediate iRules series
- Advanced iRules series
Looking for code examples? Browse our iRules Code Library.
Need a custom iRule? Get help from the experts in our Community Forum.
Use the F5 AI assistant for BIG-IP To analyze existing iRules, generate new iRules, and contextualize iRules events and commands.
Quick Links
- Command/Event Documentation
- F5 AI Assistant
- iRules on Codeshare
- iRules Style Guide
- iRules Security Pitfalls
Explore and Learn More
- irule to insert http header with values based on received radius accounting avp
- log local0. is not a debugging strategy!
- Explicit write control for iRules subtables
- Enhancing the F5 DoD Banner with EU CAPTCHA (Myra) & Sideband Validation
- Introducing Rülbased - version your iRules on BIG-IP!
- AppWorld LATAM 2026 - “Write Your First iRule” Contest
- Rethinking Payload Parsing: Native JSON Handling in iRules
- AppWorld Berlin 2026 – iRules Contest Winning Results
- SwagWAF Wins The Budget Bodyguard Award
- Generic iRule based on datagroup parsing
- SUPER-WEBSOCKET-HANDSHAKE-LOGGER™® (SWHL) iRule
- Layered Virtual Server iRule Solution for ICAP File Upload Scanning on BIG-IP
- WS-Shield: WebSocket Abuse Detection & Adaptive Enforcement Gateway
- WS-Exfil-Shield: Catching What WAFs Miss After the 101 Handshake
- AppWorld Berlin iRules Contest!
- iRules Contest Entry Example
- iRules for recreation: HTTP Protocol Parser implemented using BIG-IP iRule(unfinished)
- Help with an iRule to disconnect active connections to Pool Members that are “offline”
- F5 AppWorld 2026 Las Vegas - iRules Contest Winners!
- How to add Syslog headers to Bot Defense logs over HSL? (Missing formatting options)
- LLM Streaming Session Pinning for WebSocket AI Gateways
- AI Token Limit Enforcement
- AI/Bot Traffic Throttling iRule (UA Substring + IP Range Mapping)
- LLM Prompt Injection Detection & Enforcement
- Rate limiting WebSocket messages for Agents