# How do I print object contents as part of logging?

**URL:** <https://discuss.elastic.co/t/how-do-i-print-object-contents-as-part-of-logging/174087>\
**Category:** Logstash\
**Created:** [March 27, 2019, 10:24am UTC](https://discuss.elastic.co/t/how-do-i-print-object-contents-as-part-of-logging/174087 "2019-03-27T10:24:36Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![blueren](https://avatars.discourse-cdn.com/v4/letter/b/ecae2f/32.png) [@blueren](https://discuss.elastic.co/u/blueren)\
**Post date:** [March 27, 2019, 10:24am UTC](https://discuss.elastic.co/t/how-do-i-print-object-contents-as-part-of-logging/174087/1 "2019-03-27T10:24:36Z")

</div>

I would like to look at the contents of the input that gets sent to the filters. I have the following code inserted in one of the filters. However, I run into ruby errors. How do I print the content of [netflow] which has nested fields?

```
filter {

  ruby {
    code => '
      logger.info("Raw netflow input is as follows: ")
      logger.info("value" => event.get("[netflow]"))
    '
  }

...
...
}

```

The above errors out with the following:

```
[2019-03-27T10:20:50,282][ERROR][logstash.filters.ruby] Ruby exception occurred: #<Hash:0x71745749> is not a string

```

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:** [April 24, 2019, 10:24am UTC](https://discuss.elastic.co/t/how-do-i-print-object-contents-as-part-of-logging/174087/2 "2019-04-24T10:24:43Z")

</div>

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