# How to send multiline json file and send it to elasticsearch

**URL:** <https://discuss.elastic.co/t/how-to-send-multiline-json-file-and-send-it-to-elasticsearch/351500>\
**Category:** Logstash\
**Created:** [January 21, 2024, 3:59pm UTC](https://discuss.elastic.co/t/how-to-send-multiline-json-file-and-send-it-to-elasticsearch/351500 "2024-01-21T15:59:41Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![mancharagopan](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mancharagopan/32/60266_2.png) [@mancharagopan](https://discuss.elastic.co/u/mancharagopan)\
**Post date:** [January 21, 2024, 3:59pm UTC](https://discuss.elastic.co/t/how-to-send-multiline-json-file-and-send-it-to-elasticsearch/351500/1 "2024-01-21T15:59:41Z")

</div>

I have a json log files which is in multi line json format and i need to send it to elasticsearch as it is. how can i do it?

---

<div class="post-metadata">

**Author:** ![Rios](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rios/32/95745_2.png) [@Rios](https://discuss.elastic.co/u/Rios)\
**Post date:** [January 21, 2024, 5:45pm UTC](https://discuss.elastic.co/t/how-to-send-multiline-json-file-and-send-it-to-elasticsearch/351500/2 "2024-01-21T17:45:09Z")

</div>

Welcome to the community!

Can you provide us with a sample?

There is multiline codec as well as json codec. You should have something like this

```auto
input {
  file {
    path => ['/path/file.json']
    codec => multiline {
        pattern => '^{'
        negate => true
        what => previous
    }
  }
}
filter {
 json {
    source => "message"
  }
}

```

---

<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:** [February 18, 2024, 5:45pm UTC](https://discuss.elastic.co/t/how-to-send-multiline-json-file-and-send-it-to-elasticsearch/351500/3 "2024-02-18T17:45:24Z")

</div>

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