# Templates Boiler-plate pipeline snippets are good candidates to put into a template. For example, [transforming systemd journal records](https://git.tfks.net/erik/logbus/src/commit/79e2e33aaf0b54010f09474c76f280e867f218a3/examples/journald-elasticsearch/templates.yml#L2) is a common task. Placing that into a shared template file avoids repeating yourself while also helping to keep the pipeline config easier to read & reason about. Templates are [declared in the config file](https://git.tfks.net/erik/logbus/src/commit/79e2e33aaf0b54010f09474c76f280e867f218a3/examples/journald-elasticsearch/pipeline.yml#L3). The key under `templates` ("tfks" in the linked example) acts as a namespace when [referencing a template](https://git.tfks.net/erik/logbus/src/commit/79e2e33aaf0b54010f09474c76f280e867f218a3/examples/journald-elasticsearch/pipeline.yml#L25) in a stage. All keys in a template are included in the stage's definition. If there is a collision, then the stage's key will take precedence.