Ingest data problem after x-pack installed


(Ximeng Zhao) #1

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' -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


(Mark Walkom) #2

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


(Ximeng Zhao) #3

@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.


(Mark Walkom) #4

man curl will provide you the documentation for it.

But you want the -u and -p flags.


(Ximeng Zhao) #5

Thanks, solved.


(system) #6

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