Overview
VRL provides over 200 built-in functions optimized for observability data transformation. Functions are organized by category to help you find the right tool for your use case.Function Categories
Functions are grouped into the following categories:- Array - Array manipulation and iteration
- Checksum - Cryptographic checksums and hashing
- Codec - Encoding and decoding operations
- Coerce - Type conversion and coercion
- Convert - Data format conversions
- Cryptography - Encryption and cryptographic operations
- Debug - Debugging and inspection utilities
- Enrichment - Data enrichment from external sources
- Enumerate - Collection iteration and mapping
- Event - Event manipulation and metadata
- IP - IP address parsing and operations
- Map - Object/map manipulation
- Metrics - Metrics operations and aggregation
- Number - Numeric operations and math
- Object - Object manipulation and traversal
- Parse - Parsing structured and unstructured data
- Path - Event path operations
- Random - Random value generation
- String - String manipulation and formatting
- System - System information and operations
- Timestamp - Date and time operations
- Type - Type checking and inspection
Function Call Syntax
Functions are called using standard function call syntax:Fallibility
Many VRL functions are fallible, meaning they can fail. Fallible functions must be handled explicitly:Infallible Variant (! suffix)
The! suffix makes a fallible function abort on error:
Fallible Variant
Without!, you must handle the error:
Coalescing Operator
Use?? to provide a default value:
Common Functions by Use Case
Parsing
Parse various data formats:String Manipulation
Type Coercion
Convert between types safely:Array Operations
Object Operations
Timestamp Operations
Encoding/Decoding
Hashing and Cryptography
IP Address Operations
Enrichment
Enrich events with external data:Metrics Operations
Debugging
Control Flow
Vector-Specific Functions
Vector provides additional functions beyond the standard VRL library:Function Signatures
Each function has a specific signature defining:- Required arguments: Must be provided
- Optional arguments: Have default values
- Return type: What type the function returns
- Fallibility: Whether the function can fail
Example Function Signature
value(required): string to parsemax_depth(optional): maximum nesting depthlossy(optional): whether to allow invalid UTF-8- Returns: JSON value (object, array, string, number, boolean, null)
- Fallible: Can fail if string is invalid JSON
Best Practices
Use Infallible Variants When Appropriate
Provide Fallback Values
Check Types Before Operations
Chain Functions Carefully
Performance Considerations
- Avoid repeated parsing: Parse once, store result
- Use exists() before accessing: Prevents runtime checks
- Minimize regex complexity: Complex patterns are slower
- Prefer specific functions:
parse_jsonis faster thanparse_regexfor JSON - Cache enrichment lookups: Store results if used multiple times
Complete Function List
For the complete, up-to-date list of all VRL functions with detailed documentation:- Browse functions by category in the Vector documentation
- Use
vector vrl --helpto see function help - Visit https://vrl.dev for searchable function reference
- Check the VRL stdlib source code on GitHub
Learn More
- VRL Overview - Introduction to VRL
- VRL Expressions - Language syntax and operators
- VRL Examples - Real-world transformation examples