# Trying to use json codec on stdin - switching to json\_lines?

**URL:** <https://discuss.elastic.co/t/trying-to-use-json-codec-on-stdin-switching-to-json-lines/170910>\
**Category:** Elasticsearch\
**Created:** [March 5, 2019, 1:18pm UTC](https://discuss.elastic.co/t/trying-to-use-json-codec-on-stdin-switching-to-json-lines/170910 "2019-03-05T13:18:10Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![djmcgreal-cc](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/djmcgreal-cc/32/85463_2.png) [@djmcgreal-cc](https://discuss.elastic.co/u/djmcgreal-cc)\
**Post date:** [March 5, 2019, 1:18pm UTC](https://discuss.elastic.co/t/trying-to-use-json-codec-on-stdin-switching-to-json-lines/170910/1 "2019-03-05T13:18:10Z")

</div>

My interpretation of [https://www.elastic.co/guide/en/logstash/6.6/plugins-codecs-json.html](https://www.elastic.co/guide/en/logstash/6.6/plugins-codecs-json.html) is that if I have `input { stdin { codec => json } }` I should be able to pipe in e.g.

```
[
    {"event": 1},
    {"event": 2}
 ]

```

And get two events processed into the pipeline. However, I'm always getting `[INFO][logstash.inputs.stdin] Automatically switching from json to json_lines codec {:plugin=>"stdin"}`

Is my interpretation of the documentation incorrect? Is it a problem with it being multiline? (I actually compress the JSON into one line with `jq -cM . input.json` before pipeing it into logstash)

Thanks, Dan.

---

<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 2, 2019, 1:25pm UTC](https://discuss.elastic.co/t/trying-to-use-json-codec-on-stdin-switching-to-json-lines/170910/2 "2019-04-02T13:25:02Z")

</div>

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