# Convert an inner field using regex for the field name

**URL:** https://discuss.elastic.co/t/convert-an-inner-field-using-regex-for-the-field-name/184980
**Category:** Logstash
**Created:** [June 10, 2019, 11:39am UTC](https://discuss.elastic.co/t/convert-an-inner-field-using-regex-for-the-field-name/184980 "2019-06-10T11:39:17Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![shlomit](https://avatars.discourse-cdn.com/v4/letter/s/d9b06d/32.png) [@shlomit](https://discuss.elastic.co/u/shlomit)
#### Post date: [June 10, 2019, 11:39am UTC](https://discuss.elastic.co/t/convert-an-inner-field-using-regex-for-the-field-name/184980/1 "2019-06-10T11:39:17Z")

</div>

Hi,

For my json events processing, I need the mutate filter with convert, for inner fields with a name format such as:

filter {  
mutate {  
convert =\> {  
"[additionalData][contentCount\_1]" =\> "integer"  
"[additionalData][contentCount\_2]" =\> "integer"  
"[additionalData][contentCount\_3]" =\> "integer"  
}  
}  
}

I look up for a way to use regex for this field name, to make it more dynamic. I don't know in advance how many additionalData.contentCount\_\* fields will be included in the event.  
Is there any syntax for this? I'd really appreciate avoiding ruby script...

Thanks.

---

<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 8, 2019, 11:39am UTC](https://discuss.elastic.co/t/convert-an-inner-field-using-regex-for-the-field-name/184980/2 "2019-07-08T11:39:18Z")

</div>

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