# Exception Handling

**URL:** <https://discuss.elastic.co/t/exception-handling/38989>\
**Category:** Logstash\
**Created:** [January 12, 2016, 2:21pm UTC](https://discuss.elastic.co/t/exception-handling/38989 "2016-01-12T14:21:24Z")\
**Posts on this page:** 1\
**Showing post:** 2

<div class="post-metadata">

**Author:** ![magnusbaeck](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/magnusbaeck/32/44943_2.png) [@magnusbaeck](https://discuss.elastic.co/u/magnusbaeck)\
**Post date:** [January 12, 2016, 6:47pm UTC](https://discuss.elastic.co/t/exception-handling/38989/2 "2016-01-12T18:47:01Z")

</div>

If the date parsing fails the message will by default get the tag `_dateparsefailure` so you can do something like this:

```auto
filter {
  date {
    ...
  }
}

output {
  if "_dateparsefailure" in [tags] {
    file {
      path => ".../date_parse_errors.log"
    }
  }
}

```

---

_[View the full topic](https://discuss.elastic.co/t/exception-handling/38989)._
