# Printing stdout {codec =\> rubydebug} only on error

**URL:** <https://discuss.elastic.co/t/printing-stdout-codec-rubydebug-only-on-error/240598>\
**Category:** Logstash\
**Created:** [July 9, 2020, 7:48pm UTC](https://discuss.elastic.co/t/printing-stdout-codec-rubydebug-only-on-error/240598 "2020-07-09T19:48:25Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![pgervais](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@pgervais](https://discuss.elastic.co/u/pgervais)\
**Post date:** [July 9, 2020, 7:48pm UTC](https://discuss.elastic.co/t/printing-stdout-codec-rubydebug-only-on-error/240598/1 "2020-07-09T19:48:26Z")

</div>

How can I control the output section of a logstash config to only print the stdout {codec =\> rubydebug} on an error? for example , on a \_dateparsefailure.

---

<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:** [July 9, 2020, 7:49pm UTC](https://discuss.elastic.co/t/printing-stdout-codec-rubydebug-only-on-error/240598/2 "2020-07-09T19:49:43Z")

</div>

```
output { if "_dateparsefailure" in [tags] { stdout {} } }
```

---

<div class="post-metadata">

**Author:** ![pgervais](https://avatars.discourse-cdn.com/v4/letter/p/65b543/32.png) [@pgervais](https://discuss.elastic.co/u/pgervais)\
**Post date:** [July 9, 2020, 8:36pm UTC](https://discuss.elastic.co/t/printing-stdout-codec-rubydebug-only-on-error/240598/3 "2020-07-09T20:36:16Z")

</div>

Badger,  
Works like a charm.

---

<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:** [August 6, 2020, 8:50pm UTC](https://discuss.elastic.co/t/printing-stdout-codec-rubydebug-only-on-error/240598/4 "2020-08-06T20:50:10Z")

</div>

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