# Have Logstash take a file containing an array of JSON objects

**URL:** <https://discuss.elastic.co/t/have-logstash-take-a-file-containing-an-array-of-json-objects/150233>\
**Category:** Logstash\
**Created:** [September 27, 2018, 5:52pm UTC](https://discuss.elastic.co/t/have-logstash-take-a-file-containing-an-array-of-json-objects/150233 "2018-09-27T17:52:40Z")\
**Posts on this page:** 1\
**Showing post:** 4

<div class="post-metadata">

**Author:** ![guyboertje](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/guyboertje/32/31592_2.png) [@guyboertje](https://discuss.elastic.co/u/guyboertje)\
**Post date:** [September 28, 2018, 8:27pm UTC](https://discuss.elastic.co/t/have-logstash-take-a-file-containing-an-array-of-json-objects/150233/4 "2018-09-28T20:27:18Z")

</div>

There is a little known side effect of setting an impossible delimiter in both the file input and the json\_lines codec - it means the whole file is read as the payload to the json\_lines codec. The json\_line codec will create an event from each object in your JSON array. However, bear in mind the potential memory usage when the whole file is read into memory.

```auto
input {
  file {
    codec => json_lines {
      delimiter => "øøøøøø"
    }
    path => "path/to/json"
    start_position => "beginning"
    sincedb_path => "dev/null"
    delimiter => "øøøøøø"
  }
}

```

I have used this technique int this thread [Denormalize data within a log file](https://discuss.elastic.co/t/denormalize-data-within-a-log-file/141277/17?u=guyboertje)

---

_[View the full topic](https://discuss.elastic.co/t/have-logstash-take-a-file-containing-an-array-of-json-objects/150233)._
