# Convert value of nested date field to UTC with date filter

**URL:** <https://discuss.elastic.co/t/convert-value-of-nested-date-field-to-utc-with-date-filter/236250>\
**Category:** Logstash\
**Created:** [June 9, 2020, 1:50am UTC](https://discuss.elastic.co/t/convert-value-of-nested-date-field-to-utc-with-date-filter/236250 "2020-06-09T01:50:22Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![alxsss](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/alxsss/32/69929_2.png) [@alxsss](https://discuss.elastic.co/u/alxsss)\
**Post date:** [June 9, 2020, 1:50am UTC](https://discuss.elastic.co/t/convert-value-of-nested-date-field-to-utc-with-date-filter/236250/1 "2020-06-09T01:50:22Z")

</div>

Hello,

I am trying to convert values of all date fields to UTC. I use date filter, which works fine for top level fields. However, looks like it does not work for nested fields like

"abc" : [  
{  
"dateField" : "2020-09-11T00:00:00-08:00",  
}  
]  
I tried date filter like  
date {  
match =\> ["[abc][dateField]" , "ISO8601" , "yyyy-MM-dd'T'HH:mm:ss.SSS a Z" ]  
target =\> "[abc][dateField]"  
locale =\> "en"  
#timezone =\> "America/Los\_Angeles"  
}

but there is no change.

Any ideas what is wrong here?  
Thx in advance.

---

<div class="post-metadata">

**Author:** ![ptamba](https://avatars.discourse-cdn.com/v4/letter/p/7feea3/32.png) [@ptamba](https://discuss.elastic.co/u/ptamba)\
**Post date:** [June 9, 2020, 2:41am UTC](https://discuss.elastic.co/t/convert-value-of-nested-date-field-to-utc-with-date-filter/236250/2 "2020-06-09T02:41:01Z")

</div>

> [@alxsss](#):
>
> "abc" : [  
> {  
> "dateField" : "2020-09-11T00:00:00-08:00",  
> }  
> ]

this is not nested but array. if there's only one entry, you should be able to access it with [abc][0][dateField]

if it's arbitrary length, you will need ruby filter to iterate over it.

---

<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 7, 2020, 2:41am UTC](https://discuss.elastic.co/t/convert-value-of-nested-date-field-to-utc-with-date-filter/236250/3 "2020-07-07T02:41:10Z")

</div>

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