Bulk Load API not uploading entire JSON file

Hi I created an 82 KB JSON log file but when I use the code, output says following

---------------------------------------------------------------------------------------------------------------------
> = Check upload
health status index    uuid                   pri rep docs.count docs.deleted store.size pri.store.size
green  open   cpu-data mPae5r4GSdqFdYtdb_Zd7Q   1   0          0            0       230b           230b
-----------------------------------------------------------------------------------------------------------------------

Below is the script i use to upload my file:
    #!/bin/bash

HOST='localhost'
PORT=9200
INDEX_NAME='cpu-data'
URL="http://${HOST}:${PORT}"
printf "\n== Script for creating index and uploading data == \n \n"
printf "\n== Deleting old index == \n\n"
curl -s -X DELETE ${URL}/${INDEX_NAME}

printf "\n== Creating Index - ${INDEX_NAME} == \n\n"
curl -s -X PUT -H 'Content-Type: application/json' ${URL}/${INDEX_NAME} -d '{
   "settings":{
      "number_of_shards":1,
      "number_of_replicas":0
   },
   "mappings":{
      "properties":{
            "@timestamp":{
               "type":"date"
            },
            "count":{
               "type":"long"
            }
         }
      }
   }
}'

printf "\n== Bulk uploading data to index... \n"
for i in `seq 1 1`;
do
    curl -s -X POST -H "Content-Type: application/json" ${URL}/${INDEX_NAME}/_bulk --data-binary "cpu-data.json" > /dev/null

    printf "\nData uploaded"
done

printf "\n done - output to /dev/null"

printf "\n\n== Check upload \n"
curl -s -X GET ${URL}/_cat/indices/${INDEX_NAME}?v

printf "\n Server-metrics uploaded \n "

The JSON file is available here

Why is the entire JSON file not being uploaded?

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