# Append Field Value to Each Log Message processed by Filebeat

**URL:** <https://discuss.elastic.co/t/append-field-value-to-each-log-message-processed-by-filebeat/177895>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [April 22, 2019, 7:41pm UTC](https://discuss.elastic.co/t/append-field-value-to-each-log-message-processed-by-filebeat/177895 "2019-04-22T19:41:14Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![thadc](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@thadc](https://discuss.elastic.co/u/thadc)\
**Post date:** [April 22, 2019, 7:41pm UTC](https://discuss.elastic.co/t/append-field-value-to-each-log-message-processed-by-filebeat/177895/1 "2019-04-22T19:41:15Z")

</div>

Hello,

I have a use case where I would like to append a field to each log message that is processed by filebeat. The value would be based upon the type of log read by filebeat.

For instance, lets say I have 3 log types: typeA, typeB, typeC. When filebeat recognizes an update to log type A, it appends a typeA value to each message before output the message.

I have a basic filebeat.yml configured and running, but I cannot figure out how to append data to each message.

Grateful for any insight. thanks

---

<div class="post-metadata">

**Author:** ![thadc](https://avatars.discourse-cdn.com/v4/letter/t/7cd45c/32.png) [@thadc](https://discuss.elastic.co/u/thadc)\
**Post date:** [April 23, 2019, 4:25pm UTC](https://discuss.elastic.co/t/append-field-value-to-each-log-message-processed-by-filebeat/177895/2 "2019-04-23T16:25:15Z")

</div>

Hi, I'll answer my own post. I added a field key/val pair for each log type.

```auto
filebeat.inputs:
- type: log
  path: /path_to_my_typeA
  fields:
    name_of_my_additional_field: typeA

```

---

<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:** [May 21, 2019, 4:25pm UTC](https://discuss.elastic.co/t/append-field-value-to-each-log-message-processed-by-filebeat/177895/3 "2019-05-21T16:25:17Z")

</div>

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