# Move json file to elasticsearch

**URL:** <https://discuss.elastic.co/t/move-json-file-to-elasticsearch/193644>\
**Category:** Logstash\
**Created:** [August 3, 2019, 4:47pm UTC](https://discuss.elastic.co/t/move-json-file-to-elasticsearch/193644 "2019-08-03T16:47:29Z")\
**Posts on this page:** 8\
**Page:** 2

<div class="post-metadata">

**Author:** ![Jim\_Palazzolo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jim_palazzolo/32/47451_2.png) [@Jim\_Palazzolo](https://discuss.elastic.co/u/Jim_Palazzolo)\
**Post date:** [August 4, 2019, 2:26pm UTC](https://discuss.elastic.co/t/move-json-file-to-elasticsearch/193644/21 "2019-08-04T14:26:11Z")

</div>

files about 1.2 gig  
no idea how many lines...

---

<div class="post-metadata">

**Author:** ![Jim\_Palazzolo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jim_palazzolo/32/47451_2.png) [@Jim\_Palazzolo](https://discuss.elastic.co/u/Jim_Palazzolo)\
**Post date:** [August 4, 2019, 2:52pm UTC](https://discuss.elastic.co/t/move-json-file-to-elasticsearch/193644/22 "2019-08-04T14:52:07Z")

</div>

my guess is that the json file is not newline delimited json and that's what's mucking it up now...

---

<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:** [August 4, 2019, 3:02pm UTC](https://discuss.elastic.co/t/move-json-file-to-elasticsearch/193644/23 "2019-08-04T15:02:18Z")

</div>

That would indeed be a problem. If that were the case it would ingest the whole file as a single event. This is java so characters are 2 bytes. So the event would be 2.4 GB, and the message it builds to send to elasticsearch would be another 2.4 GB. So you would need at least 5 GB of heap.

I would look into reformatting the input file.

---

<div class="post-metadata">

**Author:** ![Jim\_Palazzolo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jim_palazzolo/32/47451_2.png) [@Jim\_Palazzolo](https://discuss.elastic.co/u/Jim_Palazzolo)\
**Post date:** [August 4, 2019, 3:11pm UTC](https://discuss.elastic.co/t/move-json-file-to-elasticsearch/193644/24 "2019-08-04T15:11:21Z")

</div>

Yea - I fixed the heap error.

I have the heap 8 gigs, and put 12 gigs ram on the box...

I ran a python script that I found hoping it would fix data, but it still hangs, so i'm not entirely sure if it's formatted correctly...

---

<div class="post-metadata">

**Author:** ![Jim\_Palazzolo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jim_palazzolo/32/47451_2.png) [@Jim\_Palazzolo](https://discuss.elastic.co/u/Jim_Palazzolo)\
**Post date:** [August 4, 2019, 3:13pm UTC](https://discuss.elastic.co/t/move-json-file-to-elasticsearch/193644/25 "2019-08-04T15:13:04Z")

</div>

nope - looks like the commas are still in the file - the script looked like it would replace all the commas with carriage returns...

my guess is that, from your description, i would need something more than simply carriage returns if i wanted new documents per event within the file...

---

<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:** [August 4, 2019, 3:44pm UTC](https://discuss.elastic.co/t/move-json-file-to-elasticsearch/193644/26 "2019-08-04T15:44:15Z")

</div>

No, provided the JSON are newline (not CR) separated the file input should consume each line as an event.

---

<div class="post-metadata">

**Author:** ![Jim\_Palazzolo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/jim_palazzolo/32/47451_2.png) [@Jim\_Palazzolo](https://discuss.elastic.co/u/Jim_Palazzolo)\
**Post date:** [August 5, 2019, 3:58pm UTC](https://discuss.elastic.co/t/move-json-file-to-elasticsearch/193644/27 "2019-08-05T15:58:57Z")

</div>

Figured it out - now just need to nail down the issue with the "Event.date" field...  
I get all the documents in just fine, but ES/Kibana doesn't like the date at all.

---

<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:** [September 2, 2019, 4:06pm UTC](https://discuss.elastic.co/t/move-json-file-to-elasticsearch/193644/28 "2019-09-02T16:06:18Z")

</div>

Closed on September 2, 2019, 4:06pm UTC

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

[Previous page](https://discuss.elastic.co/t/move-json-file-to-elasticsearch/193644.md?page=1)
