# Apply timezone in date process pipeline based on a field

**URL:** <https://discuss.elastic.co/t/apply-timezone-in-date-process-pipeline-based-on-a-field/106197>\
**Category:** Elasticsearch\
**Created:** [November 2, 2017, 12:48pm UTC](https://discuss.elastic.co/t/apply-timezone-in-date-process-pipeline-based-on-a-field/106197 "2017-11-02T12:48:50Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![asher\_frenkel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/asher_frenkel/32/23701_2.png) [@asher\_frenkel](https://discuss.elastic.co/u/asher_frenkel)\
**Post date:** [November 2, 2017, 12:48pm UTC](https://discuss.elastic.co/t/apply-timezone-in-date-process-pipeline-based-on-a-field/106197/1 "2017-11-02T12:48:50Z")

</div>

is it possible to apply timezone option on the date process pipeline based on \_source field?  
I was trying something like:  
{  
"date": {  
"field": "system.auth.timestamp",  
"formats": [  
"MMM d HH:mm:ss",  
"MMM dd HH:mm:ss"  
],  
"timezone": "{{ \_source.fields.timezone }}",  
"ignore\_failure": true,  
"target\_field": "@timestamp"  
}

but elasticsearch reject my pipeline:{  
"error": {  
"root\_cause": [  
{  
"type": "exception",  
"reason": "java.lang.IllegalArgumentException: The datetime zone id '{{ \_source.fields.timezone }}' is not recognised",  
"header": {  
"processor\_type": "date"  
}  
}  
],  
"type": "exception",  
"reason": "java.lang.IllegalArgumentException: The datetime zone id '{{ \_source.fields.timezone }}' is not recognised",  
"caused\_by": {  
"type": "illegal\_argument\_exception",  
"reason": "The datetime zone id '{{ \_source.fields.timezone }}' is not recognised"  
},  
"header": {  
"processor\_type": "date"  
}  
},  
"status": 500  
}

is there any way I can achieve this?

---

<div class="post-metadata">

**Author:** ![spinscale](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/spinscale/32/25011_2.png) [@spinscale](https://discuss.elastic.co/u/spinscale)\
**Post date:** [November 3, 2017, 2:57pm UTC](https://discuss.elastic.co/t/apply-timezone-in-date-process-pipeline-based-on-a-field/106197/2 "2017-11-03T14:57:15Z")

</div>

that field does not support scripting, but you could append he timezone to the timestamp field and then add a format, that supports parsing the timezone.

Would that work for 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:** [December 1, 2017, 2:57pm UTC](https://discuss.elastic.co/t/apply-timezone-in-date-process-pipeline-based-on-a-field/106197/3 "2017-12-01T14:57:23Z")

</div>

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