Lists and Macros are reusable components defined at the file level (before rules) that can be used by multiple rules in the same file.Documentation Index
Fetch the complete documentation index at: https://docs.blocklight.co/llms.txt
Use this file to discover all available pages before exploring further.
Lists
Lists are reusable address/value collections. Define them once at the top of your file, then reference them in any rule’s condition using thein operator:
Macros
Macros are reusable condition fragments. Define them once at the top of your file, then reference them in any rule’s condition:Complete Example
How It Works
- Lists and Macros are defined outside of rules (at the file level), but in the same file as your rules
- They must be defined before the rules that use them
- Macros are expanded when rules are evaluated, allowing you to reuse condition logic
- Lists used with the
inoperator are resolved at evaluation time - Multiple rules in the same file can reference the same list or macro
File Organization: While
lists and macros can be shared across rules in the same file, it’s a best practice to group related rules together (e.g., same category, threat type, or protocol). This makes maintenance easier and keeps your rule base organized. See Rule Structure for more details.When to Use Lists vs Macros
- Use Lists for collections of addresses or values that you want to check membership (
inoperator) - Use Macros for reusable condition fragments that you want to reference by name
Next Steps
Structure
Learn about rule structure
Array Methods
Working with arrays in macros
Examples
See practical usage patterns
Operators
Build conditions with operators