Ingest data problem after x-pack installed

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

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

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

man curl will provide you the documentation for it.

But you want the -u and -p flags.

Thanks, solved.

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