# Custom Metric not Adding Host.geo.country\_name

**URL:** <https://discuss.elastic.co/t/custom-metric-not-adding-host-geo-country-name/246094>\
**Category:** Beats\
**Tags:** metricbeat\
**Created:** [August 24, 2020, 10:27am UTC](https://discuss.elastic.co/t/custom-metric-not-adding-host-geo-country-name/246094 "2020-08-24T10:27:48Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Hassaan\_mustafa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hassaan_mustafa/32/49860_2.png) [@Hassaan\_mustafa](https://discuss.elastic.co/u/Hassaan_mustafa)\
**Post date:** [August 24, 2020, 10:27am UTC](https://discuss.elastic.co/t/custom-metric-not-adding-host-geo-country-name/246094/1 "2020-08-24T10:27:48Z")

</div>

```
processors:
  - add_host_metadata:
       geo:
          name: server-1
          country_name: PK
          country_iso_code: PK
          city_name: Karachi

```

after providing add\_host\_metadata still country\_name is not adding below is output of beat

`{ "@timestamp": "2020-08-24T10:15:47.394Z", "@metadata": { "beat": "strongswan", "type": "_doc", "version": "8.0.0" }, "strongswan": { "strongswan": { "counter": 1 } } "event": { "dataset": "strongswan.strongswan" }, "host": { "hostname": "inspiron-15-3567", "geo": { "country_iso_code": "PK", "city_name": "Karachi", "name": "server-1" }, "platform": "ubuntu" } }`

---

<div class="post-metadata">

**Author:** ![Mario\_Castro](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mario_castro/32/35107_2.png) [@Mario\_Castro](https://discuss.elastic.co/u/Mario_Castro)\
**Post date:** [August 25, 2020, 11:50am UTC](https://discuss.elastic.co/t/custom-metric-not-adding-host-geo-country-name/246094/2 "2020-08-25T11:50:42Z")

</div>

Hi @Hassaan_mustafa 🙂

Can you open a Github issue in Beats repo? [https://github.com/elastic/beats/issues](https://github.com/elastic/beats/issues) I think it's a mistake in the docs because I think we don't parse any `country_name` in that config, only `country_iso_code`

Thanks!

---

<div class="post-metadata">

**Author:** ![Hassaan\_mustafa](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/hassaan_mustafa/32/49860_2.png) [@Hassaan\_mustafa](https://discuss.elastic.co/u/Hassaan_mustafa)\
**Post date:** [August 26, 2020, 10:22am UTC](https://discuss.elastic.co/t/custom-metric-not-adding-host-geo-country-name/246094/3 "2020-08-26T10:22:42Z")

</div>

> [@Hassaan\_mustafa](#):
>
> { "@timestamp": "2020-08-24T10:15:47.394Z", "@metadata": { "beat": "strongswan", "type": "\_doc", "version": "8.0.0" }, "strongswan": { "strongswan": { "counter": 1 } } "event": { "dataset": "strongswan.strongswan" }, "host": { "hostname": "inspiron-15-3567", "geo": { "country\_iso\_code": "PK", "city\_name": "Karachi", "name": "server-1" }, "platform": "ubuntu" } }

created

> <https://github.com/elastic/beats/issues/20796>
>
> \`\`\`
> processors:
> - add\_host\_metadata:
> geo:
> name: server-1
> …
> country\_name: PK
> country\_iso\_code: PK
> city\_name: Karachi
> \`\`\`
> 
> after providing add\_host\_metadata as per document still country\_name is not adding below is output of beat 
> 
> \`{
> "@timestamp": "2020-08-24T10:15:47.394Z",
> "@metadata": {
> "beat": "strongswan",
> "type": "\_doc",
> "version": "8.0.0"
> },
> "strongswan": {
> "strongswan": {
> "counter": 1
> }
> },
> "event": {
> "dataset": "strongswan.strongswan"
> },
> "host": {
> "hostname": "inspiron-15-3567",
> "geo": {
> "country\_iso\_code": "PK",
> "city\_name": "Karachi",
> "name": "server-1"
> },
> "platform": "ubuntu"
> }
> }\`

---

<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:** [September 23, 2020, 12:22pm UTC](https://discuss.elastic.co/t/custom-metric-not-adding-host-geo-country-name/246094/4 "2020-09-23T12:22:45Z")

</div>

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