---
title: Add Hostname Processor
description: >-
  Learn how to use the Add Hostname processor to add a field with the name of
  the host that sent the log.
breadcrumbs: Docs > Observability Pipelines > Processors > Add Hostname Processor
---

> For the complete documentation index, see [llms.txt](https://docs.datadoghq.com/llms.txt).

# Add Hostname Processor
Available for:
{% icon name="icon-logs" /%}
 Logs 
## Overview{% #overview %}

This processor adds a field with the name of the host that sent the log. For example, `hostname: 613e197f3526`. **Note**: If the `hostname` already exists, the Worker throws an error and does not overwrite the existing `hostname`.

## Setup{% #setup %}

To set up this processor:

- Define a filter query. See [Logs Search Syntax](https://docs.datadoghq.com/observability_pipelines/search_syntax/logs.md) for more information.
  - Only logs that match the specified filter query are processed.
  - All logs, regardless of whether they match the filter query, are sent to the next step in the pipeline.
