Want to drop similar looking messages?
In Logs & traces, hover over any log entry and click Mark as spam to set it up quickly. Learn more about detecting log patterns.
Transform your data in real time with VRL in Better Stack. VRL is a lightweight, expressive scripting language designed for data transformations. It allows you to modify, enrich, or filter your data before ingestion.
For complete details on VRL syntax and capabilities, please refer to the official VRL documentation.
To apply VRL transformations in Better Stack, navigate to Sources → your source → Configure → Transformations tab.
In the editor, you can write VRL scripts that modify each event as it’s received. For example, you can use this to rename fields, parse data, filter your data before ingesting, or redact sensitive information.
Remove unwanted fields to reduce noise or protect sensitive data.
Redact sensitive information using regex patterns. This transformation will remove any emails or IP addresses from your data before they are saved in Better Stack.
Filter out events that aren’t needed, for example debug-level logs. Since VRL transformations happen before the data is ingested, you can use them to reduce your usage.
Want to drop similar looking messages?
In Logs & traces, hover over any log entry and click Mark as spam to set it up quickly. Learn more about detecting log patterns.
You can split a single record into multiple records. This is useful when one record contains a batch of events.
You can parse structured data out of your events, either by using built-in parsing functions or custom regexes.
VRL transformations are executed before data is ingested. This means that any removed fields or dropped events never get stored, reducing volume, and optimizing storage costs.
Start small, test your VRL scripts, and refine them over time to suit your needs. With VRL, you gain powerful, real-time control over your data right at the ingestion point.
Using the Test transformation button with a sample of your data used as input can give you quick feedback.
The official VRL documentation is a great place to learn about available functions, error handling, or more details about the syntax.
You can tweak and test your regexes using regex101.com, selecting the Golang flavor for consistent results.
Using ! after a function in your transformation can lead to runtime errors.
If that happens, Better Stack will not drop the event. You still can find the untransformed event in Logs & traces, including extra fields _ingest.error and _ingest.transform_error so you can identify what went wrong.
To avoid transformation failures, use Vector error handling to safely handle expected edge cases:
This way, you can ensure a reliable transformation! 🚀
When sending strings containing JSON data, Better Stack will automatically parse the JSON into structured data.
The VRL transformation happens after the JSON is parsed. Feel free to use VRL transformations to rename the extracted fields.
We use cookies to authenticate users, improve the product user experience, and for personalized ads. Learn more.