# Problem with json bulk import to elasticsearch ( jq: error: orders/0 is not defined at \<top-level\>, line 1: )

**URL:** <https://discuss.elastic.co/t/problem-with-json-bulk-import-to-elasticsearch-jq-error-orders-0-is-not-defined-at-top-level-line-1/248625>\
**Category:** Elasticsearch\
**Created:** [September 15, 2020, 8:00am UTC](https://discuss.elastic.co/t/problem-with-json-bulk-import-to-elasticsearch-jq-error-orders-0-is-not-defined-at-top-level-line-1/248625 "2020-09-15T08:00:57Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bahar\_Yilmaz](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bahar_yilmaz/32/46274_2.png) [@Bahar\_Yilmaz](https://discuss.elastic.co/u/Bahar_Yilmaz)\
**Post date:** [September 15, 2020, 8:00am UTC](https://discuss.elastic.co/t/problem-with-json-bulk-import-to-elasticsearch-jq-error-orders-0-is-not-defined-at-top-level-line-1/248625/1 "2020-09-15T08:00:58Z")

</div>

Hi,

I have problem with json bulk importing to elasticsearch. I want to send json data to elasticsearch as bulk request.

My json data looks like this

![json](https://us1.discourse-cdn.com/elastic/original/3X/e/2/e2ae1016cde0a64ab48dbaa0dd3f4d2aca8cdcef.png)

And this is the command I'm trying to make a bulk request by converting json to bulk doc.

`cat order.json | jq -c '.[] | {"index": {"_index": "orders", "_type": "doc"}}, .' | Invoke-RestMethod "http://localhost:9200/orders/doc/_bulk?pretty" -Method Post -ContentType 'application/x-ndjson' -InFile "order.json"`

And I'm getting error . I don't know what to do.

 ![Ekran Alıntısı](https://us1.discourse-cdn.com/elastic/original/3X/7/8/7819b1c81ad01a593075f7327821bb6aee8b1ae8.png)

I'm Windows user and working with Powershell.

Thanks in advance.

---

<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:** [October 13, 2020, 8:01am UTC](https://discuss.elastic.co/t/problem-with-json-bulk-import-to-elasticsearch-jq-error-orders-0-is-not-defined-at-top-level-line-1/248625/2 "2020-10-13T08:01:08Z")

</div>

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