# Email Analyzer and Domain Field

**URL:** <https://discuss.elastic.co/t/email-analyzer-and-domain-field/186328>\
**Category:** Elasticsearch\
**Created:** [June 18, 2019, 6:02pm UTC](https://discuss.elastic.co/t/email-analyzer-and-domain-field/186328 "2019-06-18T18:02:17Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Vincent\_Stevenson](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/vincent_stevenson/32/48477_2.png) [@Vincent\_Stevenson](https://discuss.elastic.co/u/Vincent_Stevenson)\
**Post date:** [June 18, 2019, 6:02pm UTC](https://discuss.elastic.co/t/email-analyzer-and-domain-field/186328/1 "2019-06-18T18:02:17Z")

</div>

I have a Json field called UserId in each document. I would like to create a new field that contains only the email domain.

Example:  
{ "FirstName" : "John", "LastName" : "Smith", "Email" : "jsmith@gmail.com" }

How do I create an analyzer and a copy\_to field that will let me have an additional field: EmailDomain : "[gmail.com](http://gmail.com)"

I know that the tokenizer will be the @ char, but I don't know how to create the analyzer, etc to do the rest of this.

Thank you!

---

<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 16, 2019, 6:02pm UTC](https://discuss.elastic.co/t/email-analyzer-and-domain-field/186328/2 "2019-07-16T18:02:27Z")

</div>

Closed on July 16, 2019, 6:02pm UTC

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