Custom VRL
Creating a Custom Transformation
Writing VRL
How Transformations Work
# return exits early, but does NOT modify the log event
# "unmodified" is ignored and the log event (.) passes through unmodified
if bool(.skip_transform) ?? false {
return "unmodified"
}
# This modifies the log event - .new_field will be in the output
.new_field = "hello"Available Functions
Error Handling
Pattern 1: The ?? Operator (Fallback Values)
Pattern 2: Explicit Error Checking
Handling Unwanted Events
Example Transformations
Normalizing Custom Logs to ECS
Extract a field with a regex
Tagging Events by IP Range
Flattening Arrays (1:N Transform)
Dropping Events Conditionally
Enriching with Lookup Tables
CIDR-Based Tagging with Lookup Tables
Resources
Last updated
Was this helpful?