# Metricbeat - Add a custom field with existing value

**URL:** <https://discuss.elastic.co/t/metricbeat-add-a-custom-field-with-existing-value/213873>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [January 6, 2020, 10:12am UTC](https://discuss.elastic.co/t/metricbeat-add-a-custom-field-with-existing-value/213873 "2020-01-06T10:12:50Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Sudharshan\_K\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sudharshan_k_s/32/60319_2.png) [@Sudharshan\_K\_S](https://discuss.elastic.co/u/Sudharshan_K_S)\
**Post date:** [January 6, 2020, 10:12am UTC](https://discuss.elastic.co/t/metricbeat-add-a-custom-field-with-existing-value/213873/1 "2020-01-06T10:12:50Z")

</div>

How can i add a custom field whose value will be equal to an exiting field  
**Eg**

```auto
processors:
-add_fields:
    fields:
      new_field: host.name

```

---

<div class="post-metadata">

**Author:** ![Kaiyan\_Sheng](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/kaiyan_sheng/32/38247_2.png) [@Kaiyan\_Sheng](https://discuss.elastic.co/u/Kaiyan_Sheng)\
**Post date:** [January 30, 2020, 8:47pm UTC](https://discuss.elastic.co/t/metricbeat-add-a-custom-field-with-existing-value/213873/2 "2020-01-30T20:47:03Z")

</div>

Sorry for the late response. I believe you can use the `add_fields` processor in Metricbeat: [https://www.elastic.co/guide/en/beats/metricbeat/current/add-fields.html](https://www.elastic.co/guide/en/beats/metricbeat/current/add-fields.html)

---

<div class="post-metadata">

**Author:** ![Sudharshan\_K\_S](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/sudharshan_k_s/32/60319_2.png) [@Sudharshan\_K\_S](https://discuss.elastic.co/u/Sudharshan_K_S)\
**Post date:** [January 31, 2020, 8:15am UTC](https://discuss.elastic.co/t/metricbeat-add-a-custom-field-with-existing-value/213873/3 "2020-01-31T08:15:20Z")

</div>

Yes, I know that new fields can be added. But my question is if that new field's value can be set from existing field-value.  
For example make the new field value equal to the host.name.  
Since host.name has the value equal to hostname of that system and which is already set by the metricbeat.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [February 28, 2020, 8:15am UTC](https://discuss.elastic.co/t/metricbeat-add-a-custom-field-with-existing-value/213873/4 "2020-02-28T08:15:22Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
