---
title: "template and rewrite: Format, modify, and manipulate log messages"
url: "https://axoflow.com/docs/axosyslog-core/4.28/chapter-manipulating-messages/"
description: "Reformat messages with templates and macros, change message content with rewrite rules, and look up the supported regular expression types."
last_modified: "2026-10-01T14:05:08+02:00"
---

> For the complete documentation index, see [llms.txt](https://axoflow.com/docs/axosyslog-core/4.28/llms.txt).

# template and rewrite: Format, modify, and manipulate log messages

Reformat messages with templates and macros, change message content with rewrite rules, and look up the supported regular expression types.

> **FilterX or classic filters, parsers, and rewrite rules?:**
> [FilterX](https://axoflow.com/docs/axosyslog-core/4.28/filterx/index.md) replaces filters, parsers, and rewrite rules with a single typed language that can also handle nested JSON and other complex data. You don’t have to migrate: the classic blocks keep working, and you can use both in the same log path. To convert your existing configuration, see [Update filters to FilterX](https://axoflow.com/docs/axosyslog-core/4.28/filterx/update-filters/index.md).

This chapter explains the methods that you can use to customize, reformat, and modify log messages using AxoSyslog.

- [Customize message format using macros and templates](https://axoflow.com/docs/axosyslog-core/4.28/chapter-manipulating-messages/customizing-message-format/index.md) explains how to use templates and macros to change the format of log messages, or the names of logfiles and database tables.
- [Modify messages using rewrite rules](https://axoflow.com/docs/axosyslog-core/4.28/chapter-manipulating-messages/modifying-messages/index.md) describes how to use rewrite rules to search and replace certain parts of the message content.
- [Regular expressions](https://axoflow.com/docs/axosyslog-core/4.28/chapter-manipulating-messages/regular-expressions/index.md) lists the different types of regular expressions that can be used in various AxoSyslog objects like filters and rewrite rules.

---

[Customize message format using macros and templates](https://axoflow.com/docs/axosyslog-core/4.28/chapter-manipulating-messages/customizing-message-format/index.md)

[Modify messages using rewrite rules](https://axoflow.com/docs/axosyslog-core/4.28/chapter-manipulating-messages/modifying-messages/index.md)

[Regular expressions](https://axoflow.com/docs/axosyslog-core/4.28/chapter-manipulating-messages/regular-expressions/index.md)

Last modified October 1, 2026: [Move filterx chapter higher and link it from classical pages (4a7e94c3)](https://github.com/axoflow/axosyslog-core-docs/commit/4a7e94c3b1f2b935d1aa686abff2c9ee95b863bd)
