# Add field or tag on failure

**URL:** <https://discuss.elastic.co/t/add-field-or-tag-on-failure/124647>\
**Category:** Logstash\
**Created:** [March 19, 2018, 9:56pm UTC](https://discuss.elastic.co/t/add-field-or-tag-on-failure/124647 "2018-03-19T21:56:30Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pfseth](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@pfseth](https://discuss.elastic.co/u/pfseth)\
**Post date:** [March 19, 2018, 9:56pm UTC](https://discuss.elastic.co/t/add-field-or-tag-on-failure/124647/1 "2018-03-19T21:56:30Z")

</div>

The logstash documentation on "common options" says, one can add field or tags on success

Is there anyway i can add field or tag on failure ?

---

<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:** [March 20, 2018, 6:21am UTC](https://discuss.elastic.co/t/add-field-or-tag-on-failure/124647/2 "2018-03-20T06:21:25Z")

</div>

Not in general, but a number of filters (grok, csv, xml, ...) add a tag when they fail. Of course, instead of triggering on a tag you could trigger on the _absense_ of a tag (indicating that the filter failed), so whatever you want to accomplish is probably possible.

---

<div class="post-metadata">

**Author:** ![pfseth](https://avatars.discourse-cdn.com/v4/letter/p/e9bcb4/32.png) [@pfseth](https://discuss.elastic.co/u/pfseth)\
**Post date:** [March 22, 2018, 10:26pm UTC](https://discuss.elastic.co/t/add-field-or-tag-on-failure/124647/3 "2018-03-22T22:26:25Z")

</div>

Thank you @magnusbaeck

---

<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:** [April 19, 2018, 10:27pm UTC](https://discuss.elastic.co/t/add-field-or-tag-on-failure/124647/4 "2018-04-19T22:27:16Z")

</div>

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