# How to add country name field based on mobile number using Mobile\_Number using logstash

**URL:** https://discuss.elastic.co/t/how-to-add-country-name-field-based-on-mobile-number-using-mobile-number-using-logstash/289588
**Category:** Logstash
**Created:** [November 18, 2021, 12:44pm UTC](https://discuss.elastic.co/t/how-to-add-country-name-field-based-on-mobile-number-using-mobile-number-using-logstash/289588 "2021-11-18T12:44:53Z")
**Posts on this page:** 1
**Showing post:** 2

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [November 18, 2021, 3:13pm UTC](https://discuss.elastic.co/t/how-to-add-country-name-field-based-on-mobile-number-using-mobile-number-using-logstash/289588/2 "2021-11-18T15:13:22Z")

</div>

See [here](https://discuss.elastic.co/t/logstash-link-fileds-in-aggregate-filter/167272/2). You would need to rewrite libphonenumber in Ruby, and then use a translate filter to map the country code to a country name.

---

_[View the full topic](https://discuss.elastic.co/t/how-to-add-country-name-field-based-on-mobile-number-using-mobile-number-using-logstash/289588)._
