# Find number of rows/documents inserted by curl command

**URL:** <https://discuss.elastic.co/t/find-number-of-rows-documents-inserted-by-curl-command/167577>\
**Category:** Elasticsearch\
**Created:** [February 8, 2019, 6:29am UTC](https://discuss.elastic.co/t/find-number-of-rows-documents-inserted-by-curl-command/167577 "2019-02-08T06:29:43Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![Bhupendra\_Bagde](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@Bhupendra\_Bagde](https://discuss.elastic.co/u/Bhupendra_Bagde)\
**Post date:** [February 8, 2019, 6:29am UTC](https://discuss.elastic.co/t/find-number-of-rows-documents-inserted-by-curl-command/167577/1 "2019-02-08T06:29:44Z")

</div>

Hi ,  
Can anyone please tell hwo to find number of rows/documents inserted by curl command in elastic search.  
Lets say I have json file with 2k rowcount. I want to verify all 2k rows has been inserted by curl successfully (out of 2k only 1k inserted ) like that.

curl -XPUT 'localhost:9200/indexname/\_bulk' -H 'Content-Type: application/json' --data-binary @filename.json

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 8, 2019, 10:34am UTC](https://discuss.elastic.co/t/find-number-of-rows-documents-inserted-by-curl-command/167577/2 "2019-02-08T10:34:52Z")

</div>

```auto
curl -XGET 'localhost:9200/indexname/_search?size=0'

```

---

<div class="post-metadata">

**Author:** ![Bhupendra\_Bagde](https://avatars.discourse-cdn.com/v4/letter/b/4af34b/32.png) [@Bhupendra\_Bagde](https://discuss.elastic.co/u/Bhupendra_Bagde)\
**Post date:** [February 12, 2019, 9:14am UTC](https://discuss.elastic.co/t/find-number-of-rows-documents-inserted-by-curl-command/167577/3 "2019-02-12T09:14:50Z")

</div>

Thanks,  
It gives total no of documents in index only.  
I want to find out how many documents inserted by last command.  
basically I want to re-check no. of rows in my csv file are all inserted in elasticsearch.

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [February 12, 2019, 9:42am UTC](https://discuss.elastic.co/t/find-number-of-rows-documents-inserted-by-curl-command/167577/4 "2019-02-12T09:42:23Z")

</div>

This is unclear to me.

If you want to compare the number of lines in your CSV with what you have indexed, then count the number of lines in your CSV and compare this number with the response of:

```auto
curl -XGET 'localhost:9200/indexname/_search?size=0'

```

If you want to compare what has been recently inserted, then you need to have the insertion time in your documents and do a range query to only filter recent documents.

---

<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:** [March 12, 2019, 9:42am UTC](https://discuss.elastic.co/t/find-number-of-rows-documents-inserted-by-curl-command/167577/5 "2019-03-12T09:42:28Z")

</div>

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