# Problem parsing date with date filter

**URL:** <https://discuss.elastic.co/t/problem-parsing-date-with-date-filter/277329>\
**Category:** Logstash\
**Created:** [June 29, 2021, 9:47am UTC](https://discuss.elastic.co/t/problem-parsing-date-with-date-filter/277329 "2021-06-29T09:47:49Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Neelu\_Chandrasekhar](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/neelu_chandrasekhar/32/90958_2.png) [@Neelu\_Chandrasekhar](https://discuss.elastic.co/u/Neelu_Chandrasekhar)\
**Post date:** [June 29, 2021, 9:47am UTC](https://discuss.elastic.co/t/problem-parsing-date-with-date-filter/277329/1 "2021-06-29T09:47:49Z")

</div>

I have a log like this  
`{"log":"{\"@timestamp\":\"2021-06-01T02:08:25.7387857-04:00\",\"level\":\"Information\",\"messageTemplate\":\"Got patients request\",\"message\":\"Got patients request`

I am trying to parse date with grok and date filters and this how my filters are written

```auto
grok { 
		match => { "message" => ".*%{TIMESTAMP_ISO8601:log_date}.*level.*%{LOGLEVEL:LogType}.*messageTemplate\\\"\:\\"\.*%{GREEDYDATA:LogMessage}.*message.*\\\"AppName.*\"%{WORD:ApplicationName}\\\".*" } 
	}
	
	date {
		locale => "en"
		match => ["log_date", "ISO8601"]
		timezone => "America/Anguilla"
		target => "log_date"
	}

```

I am getting output like this "log\_date" =\> 0021-06-01T06:08:25.738Z 2021-06-where year field is 0021 instead of 2021 and hour field is 06 instead of 02 despite adding timezone =\> "America/Anguilla".  
Because of this I am not able to plot the date histogram properly in kibana.  
Can someone quickly help me on this? 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 27, 2021, 9:48am UTC](https://discuss.elastic.co/t/problem-parsing-date-with-date-filter/277329/2 "2021-07-27T09:48:39Z")

</div>

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