# Ingest data problem after x-pack installed

**URL:** <https://discuss.elastic.co/t/ingest-data-problem-after-x-pack-installed/103249>\
**Category:** Elasticsearch\
**Created:** [October 9, 2017, 4:17pm UTC](https://discuss.elastic.co/t/ingest-data-problem-after-x-pack-installed/103249 "2017-10-09T16:17:02Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![Ximeng\_Zhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ximeng_zhao/32/15775_2.png) [@Ximeng\_Zhao](https://discuss.elastic.co/u/Ximeng_Zhao)\
**Post date:** [October 9, 2017, 4:17pm UTC](https://discuss.elastic.co/t/ingest-data-problem-after-x-pack-installed/103249/1 "2017-10-09T16:17:02Z")

</div>

Hello all,

I have installed x-pack on both elasticsearch 5.6.2 and kibana 5.6.2. And I want to write a .json file to the elasticsearch with curl command from terminal. But it fails with following error messages.

curl -XPOST '[http://localhost:9200/flights/info](http://localhost:9200/flights/info)' -H "Content-Type:application/json" -d @airports.json

{"error":{"root\_cause":[{"type":"security\_exception","reason":"missing authentication token for REST request [/flights/info]","header":{"WWW-Authenticate":"Basic realm="security" charset="UTF-8""}}],"type":"security\_exception","reason":"missing authentication token for REST request [/flights/info]","header":{"WWW-Authenticate":"Basic realm="security" charset="UTF-8""}},"status":401}

Probably I think I did not write the command correctly, please help me.

Thanks,  
Simon

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 9, 2017, 7:33pm UTC](https://discuss.elastic.co/t/ingest-data-problem-after-x-pack-installed/103249/2 "2017-10-09T19:33:51Z")

</div>

You need to pass in the username and password for the cluster.

---

<div class="post-metadata">

**Author:** ![Ximeng\_Zhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ximeng_zhao/32/15775_2.png) [@Ximeng\_Zhao](https://discuss.elastic.co/u/Ximeng_Zhao)\
**Post date:** [October 9, 2017, 7:44pm UTC](https://discuss.elastic.co/t/ingest-data-problem-after-x-pack-installed/103249/3 "2017-10-09T19:44:12Z")

</div>

@warkolm Thanks. I found a lot ways to add a user but how to pass the username and password through curl command to complete data ingestion.

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [October 9, 2017, 8:26pm UTC](https://discuss.elastic.co/t/ingest-data-problem-after-x-pack-installed/103249/4 "2017-10-09T20:26:27Z")

</div>

`man curl` will provide you the documentation for it.

But you want the `-u` and `-p` flags.

---

<div class="post-metadata">

**Author:** ![Ximeng\_Zhao](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/ximeng_zhao/32/15775_2.png) [@Ximeng\_Zhao](https://discuss.elastic.co/u/Ximeng_Zhao)\
**Post date:** [October 9, 2017, 8:31pm UTC](https://discuss.elastic.co/t/ingest-data-problem-after-x-pack-installed/103249/5 "2017-10-09T20:31:17Z")

</div>

Thanks, solved.

---

<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:** [November 6, 2017, 8:31pm UTC](https://discuss.elastic.co/t/ingest-data-problem-after-x-pack-installed/103249/6 "2017-11-06T20:31:35Z")

</div>

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