# Bulk Load API not uploading entire JSON file

**URL:** <https://discuss.elastic.co/t/bulk-load-api-not-uploading-entire-json-file/235491>\
**Category:** Elasticsearch\
**Created:** [June 3, 2020, 8:01am UTC](https://discuss.elastic.co/t/bulk-load-api-not-uploading-entire-json-file/235491 "2020-06-03T08:01:04Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![sandeep.lachmandas](https://avatars.discourse-cdn.com/v4/letter/s/958977/32.png) [@sandeep.lachmandas](https://discuss.elastic.co/u/sandeep.lachmandas)\
**Post date:** [June 3, 2020, 8:01am UTC](https://discuss.elastic.co/t/bulk-load-api-not-uploading-entire-json-file/235491/1 "2020-06-03T08:01:04Z")

</div>

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

```auto
---------------------------------------------------------------------------------------------------------------------
> = 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:

```

```auto
    #!/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](https://hpe-my.sharepoint.com/:u:/p/sandeep_lachmandas/EbSbY3oHK5pJufshYFfpUfcBCccjos9hh3EkC0nW4jgJ-A?e=YonkCv)

Why is the entire JSON file not being uploaded?

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 1, 2020, 8:01am UTC](https://discuss.elastic.co/t/bulk-load-api-not-uploading-entire-json-file/235491/2 "2020-07-01T08:01:12Z")

</div>

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