# How to use the date filter plugin in logstash

**URL:** https://discuss.elastic.co/t/how-to-use-the-date-filter-plugin-in-logstash/302137
**Category:** Logstash
**Created:** [April 11, 2022, 5:07pm UTC](https://discuss.elastic.co/t/how-to-use-the-date-filter-plugin-in-logstash/302137 "2022-04-11T17:07:08Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![lolo\_prime](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lolo_prime/32/104204_2.png) [@lolo\_prime](https://discuss.elastic.co/u/lolo_prime)
#### Post date: [April 11, 2022, 5:07pm UTC](https://discuss.elastic.co/t/how-to-use-the-date-filter-plugin-in-logstash/302137/1 "2022-04-11T17:07:08Z")

</div>

Hi  
Please find the below format of the date:

2022-04-12T05:11:47

my config  
date {  
match =\> ["time", "ISO8601"]   
}

but it giving the data parser error  
what is the format of the above date  
any one help me out

---

<div class="post-metadata">

### Author: ![Badger](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/badger/32/25190_2.png) [@Badger](https://discuss.elastic.co/u/Badger)
#### Post date: [April 11, 2022, 6:05pm UTC](https://discuss.elastic.co/t/how-to-use-the-date-filter-plugin-in-logstash/302137/2 "2022-04-11T18:05:30Z")

</div>

When I run logstash with

```
input { generator { count => 1 lines => ['2022-04-12T05:11:47'] } }
filter { date { match => ["message", "ISO8601"] } }
output { stdout { codec => rubydebug { metadata => false } } }

```

I get

```
"@timestamp" => 2022-04-12T09:11:47Z

```

So it is parsed correctly. Note that if there is _anything_ else in your [time] field (including whitespace) it has to be in the pattern for the date filter. You cannot match against a sub-string of a field.

---

<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: [May 9, 2022, 6:05pm UTC](https://discuss.elastic.co/t/how-to-use-the-date-filter-plugin-in-logstash/302137/3 "2022-05-09T18:05:37Z")

</div>

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