# Ingest attachment doesnt support pattern for selecting field in case multiple attachment fields

**URL:** <https://discuss.elastic.co/t/ingest-attachment-doesnt-support-pattern-for-selecting-field-in-case-multiple-attachment-fields/173453>\
**Category:** Elasticsearch\
**Created:** [March 22, 2019, 8:35am UTC](https://discuss.elastic.co/t/ingest-attachment-doesnt-support-pattern-for-selecting-field-in-case-multiple-attachment-fields/173453 "2019-03-22T08:35:05Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![chetanc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/chetanc/32/17028_2.png) [@chetanc](https://discuss.elastic.co/u/chetanc)\
**Post date:** [March 22, 2019, 8:35am UTC](https://discuss.elastic.co/t/ingest-attachment-doesnt-support-pattern-for-selecting-field-in-case-multiple-attachment-fields/173453/1 "2019-03-22T08:35:05Z")

</div>

Use case:  
If there are multiple fields in json which has to be mapped as attachment. And those keys are dynamic in nature or follow some convention, then those can not be used in ingest attachment plugin.

For e.g. if I want to process attachment for fields starting with Attachment\_\*.  
Today ingest attachment plugin doesn't support this feature.

In older version, this is supported using mix of dynamic template + mapper attachment plugin.

---

<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 25, 2019, 2:06pm UTC](https://discuss.elastic.co/t/ingest-attachment-doesnt-support-pattern-for-selecting-field-in-case-multiple-attachment-fields/173453/2 "2019-03-25T14:06:30Z")

</div>

Not sure there is an easy way to do that.  
You should probably add a field within you document which is an array of the fields that need to be parsed then call [https://www.elastic.co/guide/en/elasticsearch/reference/current/foreach-processor.html](https://www.elastic.co/guide/en/elasticsearch/reference/current/foreach-processor.html) mat be?

But why do you have dynamic fields like this in the first place?

---

<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 22, 2019, 2:06pm UTC](https://discuss.elastic.co/t/ingest-attachment-doesnt-support-pattern-for-selecting-field-in-case-multiple-attachment-fields/173453/3 "2019-04-22T14:06:32Z")

</div>

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