# Add fields to IngestAttachment

**URL:** <https://discuss.elastic.co/t/add-fields-to-ingestattachment/78580>\
**Category:** Elasticsearch\
**Created:** [March 14, 2017, 6:29pm UTC](https://discuss.elastic.co/t/add-fields-to-ingestattachment/78580 "2017-03-14T18:29:08Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![Rodrigo\_Rodrigues](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rodrigo\_Rodrigues](https://discuss.elastic.co/u/Rodrigo_Rodrigues)\
**Post date:** [March 14, 2017, 6:29pm UTC](https://discuss.elastic.co/t/add-fields-to-ingestattachment/78580/1 "2017-03-14T18:29:08Z")

</div>

I'm currently using ElasticSearch to index some mail data with attachments.  
My question is how to add fields like "From", "To","Cc" of the e-mail, to the index of the ingest plugin?  
Currently it look like this:

```
{
        "description" : "Extract attachment information",
        "processors" : [
            {
                "attachment" : {
                    "field" : "data",
                }
            }
        ]
}
```

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [March 14, 2017, 8:20pm UTC](https://discuss.elastic.co/t/add-fields-to-ingestattachment/78580/2 "2017-03-14T20:20:47Z")

</div>

You mean that those fields should be automatically extracted from your email?

If so, it's not doable yet. It might be in the future with:

> <https://github.com/elastic/elasticsearch/pull/22339>

If you meant that you know on your side those fields, then I guess you just index a JSon doc which contains those fields.

---

<div class="post-metadata">

**Author:** ![Rodrigo\_Rodrigues](https://avatars.discourse-cdn.com/v4/letter/r/9fc29f/32.png) [@Rodrigo\_Rodrigues](https://discuss.elastic.co/u/Rodrigo_Rodrigues)\
**Post date:** [March 15, 2017, 12:25am UTC](https://discuss.elastic.co/t/add-fields-to-ingestattachment/78580/3 "2017-03-15T00:25:16Z")

</div>

I actually know the fields.  
Thanks for the reply!

---

<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:** [April 12, 2017, 12:25am UTC](https://discuss.elastic.co/t/add-fields-to-ingestattachment/78580/4 "2017-04-12T00:25:38Z")

</div>

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