0

I am new to windows . I was working my entire on linux. Can somebody help me here for _bulk api indexing

C:\ELK\master-1\elasticsearch\sample_data>curl -k -H 'Content-Type: application/x-ndjson' -X POST 'https://localhost:9200/bank/_bluk?pretty' -d @accounts.json curl: (6) Could not resolve host: application curl: (3) URL using bad/illegal format or missing URL

1 Answers1

0

I see you typed "_bluk" instad of "_bulk" , also you must use the --data-binary flag instead of d:

curl -s -H "Content-Type: application/x-ndjson" -XPOST localhost:9200/_bulk --data-binary "@accounts.json"

docs: https://www.elastic.co/guide/en/elasticsearch/reference/current/docs-bulk.html#bulk-curl

llermaly
  • 2,331
  • 2
  • 16
  • 29
  • Thanks you mate But I got error again. C:\ELK\master-1\elasticsearch\sample_data>curl -s -H "Content-Type: application/x-ndjson" -XPOST localhost:9200/_bulk --data-binary "@accounts.json" {"error":{"root_cause":[{"type":"illegal_argument_exception","reason":"The bulk request must be terminated by a newline [\\n]"}],"type":"illegal_argument_exception","reason":"The bulk request must be terminated by a newline [\\n]"},"status":400} – Tushar singh Nov 03 '22 at 14:31
  • thanks for your help iilernaly. I was able to use bulk api – Tushar singh Nov 03 '22 at 15:01
  • Nice. Your ndjson file needs to end with a newline. Please mark the answer as correct when you solve it – llermaly Nov 03 '22 at 17:17