Last active
January 16, 2021 01:08
-
-
Save rjurney/7aa024b66f7391403747cd84a8bec071 to your computer and use it in GitHub Desktop.
What am I doing wrong in this Elastic bulk load command? I can't figure it out!
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
while IFS= read -r "path" < "${DOC_LIST_PATH}" | |
do | |
echo "Submitting Elastic formatted docs at ${path} to Elastic index 'docs' ..." | |
curl \ | |
-X POST \ | |
-H "Content-Type: application/x-ndjson" \ | |
"https://${ES_USER}:${ES_PASSWD}@${ES_HOSTNAME}:${ES_PORT}/docs/_bulk" \ | |
--data-binary "@${path}" | |
done |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Submitting Elastic formatted docs at data/docs_elastic.json/part-00000.json to Elastic index 'docs' ... | |
Warning: Couldn't read data from file | |
Warning: "data/docs_elastic.json/part-00000.json", | |
Warning: this makes an empty POST. | |
{"error":{"root_cause":[{"type":"parse_exception","reason":"request body is required"}],"type":"parse_exception","reason":"request body is required"},"status":400} | |
... repeats for all files |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
{"create": {"_id": "ef68e997-c616-4b0b-b08e-dfc09f8cb08f"}} | |
{"id": "ef68e997-c616-4b0b-b08e-dfc09f8cb08f", "title": "@Lastmohican - Lastmohican - Yep", "description": "Yep", "thread": [{"username": "@Lastmohican", "name": "Devon Kinsey", "timestamp": "2021-01-03T00:00:00+00:00", "body": "Yep"}]} | |
... repeats for all records |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment