Creating Log Transformations
- Navigate to the Logs page in the Metoro UI.
- In the search bar, click the Transformations button (shown below) on the most left side.

- Log Transformations input pills will appear, under the search bar (see below).

- Fill in the details:
- inputAttribute: Specify the log attribute you want to transform. This can be a standard log attribute (like
message
,kubernetes.container.name
, etc.) or a custom attribute you have created from previous transformations. - regex: Enter a regular expression in re2 form to match the log messages or attributes you want to transform. Use capturing groups to extract specific parts of the log.
- outputAttribute: Enter the name of the new attribute you want to create from the transformation. This custom attribute will appear in custom columns and can be used the same way as any other log attribute for filtering and searching.
- inputAttribute: Specify the log attribute you want to transform. This can be a standard log attribute (like
You can use the
message
as inputAttribute to transform the log message, or any other log attribute that you have in your json structured logs.- To see the outputAttribute as a column in the logs table, click the Columns button (shown below) on the most right side of the search bar.

- Ta da! Your custom attribute is now available for use in log searches and saved searches.

You can use the custom attributes you create with Log Transformations to filter or as a grouping attribute in your log searches. This allows you to analyze logs based on specific patterns or extracted information.
More Examples and Features
- You can use multiple transformations in a single search. Each transformation will create a new custom attribute that can be used independently.
- You can chain transformations by using the output of one transformation as the input for another. This allows you to build complex parsing logic.
- You can use transformations to create alerts.
- You can use transformations to plot graphs.
- You can use MetoroQL syntax if you prefer to write transformations in a more structured query format. For example:
MetoroQL Syntax for Log Transformations
Syntax fortransformAttribute
in MetoroQL:
- You can use a nested transformAttribute, like this:
- You can group by the custom attribute you created using
transformAttribute
in your MetoroQL queries. For example:
- You can use the output attribute you created to filter logs in your MetoroQL queries. For example:
Easily swap between MetoroQL and UI by using the < > icon on the right side of the search bar.
