# Dynamically determine OS name

**URL:** <https://discuss.elastic.co/t/dynamically-determine-os-name/276956>\
**Category:** Beats\
**Tags:** filebeat\
**Created:** [June 24, 2021, 3:24pm UTC](https://discuss.elastic.co/t/dynamically-determine-os-name/276956 "2021-06-24T15:24:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![jleon](https://avatars.discourse-cdn.com/v4/letter/j/b77776/32.png) [@jleon](https://discuss.elastic.co/u/jleon)\
**Post date:** [June 24, 2021, 3:24pm UTC](https://discuss.elastic.co/t/dynamically-determine-os-name/276956/1 "2021-06-24T15:24:05Z")

</div>

Hi,

In the agent yml file, is there a way to dynamically determine the OS name (windows, Linux, etc) to be included in the log msgs?

I'm using filebeats version 7.x.  
I see this doc for version 6.x using Host fields, but there is no example snippet on how to use it. Also, it seems this may have been removed in 7.x

> **[Host fields | Filebeat Reference \[6.8\] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/6.8/exported-fields-host-processor.html)**

---

<div class="post-metadata">

**Author:** ![legoguy1000](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/legoguy1000/32/54301_2.png) [@legoguy1000](https://discuss.elastic.co/u/legoguy1000)\
**Post date:** [June 25, 2021, 12:14am UTC](https://discuss.elastic.co/t/dynamically-determine-os-name/276956/2 "2021-06-25T00:14:09Z")

</div>

Yes u can add the host meta data with `add_host_metadata` processor. See [Add Host metadata | Filebeat Reference [7.13] | Elastic](https://www.elastic.co/guide/en/beats/filebeat/current/add-host-metadata.html#add-host-metadata)

---

<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:** [July 23, 2021, 2:14am UTC](https://discuss.elastic.co/t/dynamically-determine-os-name/276956/3 "2021-07-23T02:14:32Z")

</div>

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