# Keep only domain.tld in field with various subdomains

**URL:** <https://discuss.elastic.co/t/keep-only-domain-tld-in-field-with-various-subdomains/301097>\
**Category:** Logstash\
**Created:** [March 30, 2022, 1:53pm UTC](https://discuss.elastic.co/t/keep-only-domain-tld-in-field-with-various-subdomains/301097 "2022-03-30T13:53: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:** [March 30, 2022, 5:34pm UTC](https://discuss.elastic.co/t/keep-only-domain-tld-in-field-with-various-subdomains/301097/2 "2022-03-30T17:34:16Z")

</div>

> [@andre22](#):
>
> Can you suggest an elegant solution for this?

No. See my discussion of this [here](https://discuss.elastic.co/t/extract-domain-with-grok/292172/2). In .uk ,or .dz (Algeria), and other TLDs, some second level domain names are names, and some are labels under which domain names are assigned by the registrar (like [co.uk](http://co.uk)). But if I wanted to register [badger2022.uk](http://badger2022.uk) then Nominet would show me dozens of registrars willing to host that as a second level domain. I could then host DNS servers for that and create [foo.bar.badger2022.uk](http://foo.bar.badger2022.uk) under it.

Trying to track the policy of hundreds of TLD registrars about name vs. label categories for their second level domains is never going to be elegant.

---

_[View the full topic](https://discuss.elastic.co/t/keep-only-domain-tld-in-field-with-various-subdomains/301097)._
