---
title: Auto-Tag Logs
sidebar:
  order: 39
---
This section explains how to use the `tag_ulog` action to automatically tag ULog files based on detected errors, enabling efficient search for files with specific issues.

The `tag_ulog` action scans ULog console logs and tags the files with error messages from specific modules.

Tags follow the format:

```bash
ERROR_<module_name>
```

For example, `ERROR_commander` indicates that the ULog file contains errors from the commander module.

The code for the `tag_ulog` action can be found in our open-source [robologs-px4](https://github.com/roboto-ai/robologs-px4-actions/blob/main/actions/tag_ulog/src/tag_ulog/__main__.py) repository.

:::note
This example uses the older `__main__.py` structure. New actions created with `roboto actions init` use `main.py` with a defined `main()` function. See the [creating your own action guide](/docs/user-guides/process-data-actions/creating-your-own-action) for the current structure.
:::

## Run Tag ULog action

1. Select the ULog file in the file browser that you want to analyze. Click on the Selected button and click Invoke Action.

![Select action](/docs/blume-assets/content/docs/_static/px4_select_invoke_action.png)

2. In the Action dialog, select the `roboto-public/tag_ulog` action from the Action Hub tab. Click Invoke Action.

![Invoke action](/docs/blume-assets/content/docs/_static/px4_invoke_action.png)

3. Wait until the invocation status shows Completed. You can now navigate back to the dataset file browser and verify that the tag was added to the file by clicking the blue chevron next to the file, or by right-clicking and selecting Metadata from the context menu.

![View metadata](/docs/blume-assets/content/docs/_static/px4_view_metadata.png)

In this example, the ULog file is tagged with `ERROR_commander`. You can search for ULog files with specific error tags on the Search page. To learn how to search across multiple ULog files based on tags, metadata, and topic statistics, refer to the next section on [search](/docs/user-guides/working-with-px4-logs/search-px4).

You can configure a [trigger](/docs/learn/concepts#triggers-section) to automatically run the `tag_ulog` action when a ULog file is uploaded to the platform.
