# Curl Output is not complete

**URL:** <https://discuss.elastic.co/t/curl-output-is-not-complete/255048>\
**Category:** Elasticsearch\
**Created:** [November 11, 2020, 11:25am UTC](https://discuss.elastic.co/t/curl-output-is-not-complete/255048 "2020-11-11T11:25:54Z")\
**Posts on this page:** 8\
**Page:** 1

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [November 11, 2020, 11:25am UTC](https://discuss.elastic.co/t/curl-output-is-not-complete/255048/1 "2020-11-11T11:25:55Z")

</div>

Hello Team

I am using Elasticsearch Version 7.8.0.

I am executing an query on Elasticsearch index. The output of CURL command is not complete, IT shows incomplete records only.

I suppose there is some limit / default values due to which this output is limited.

```auto
curl -X POST "localhost:9200/_sql?format=txt&pretty=true" -H 'Content-Type: application/json' -d'
{
  "query": "SELECT userId from myindex"
}
'

```

could you please help me in understanding and getting the required output.

Thanks  
Tushar Nemade

---

<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:** [November 11, 2020, 1:34pm UTC](https://discuss.elastic.co/t/curl-output-is-not-complete/255048/2 "2020-11-11T13:34:49Z")

</div>

May be this would help?

> **[Paginating through a large response | Elasticsearch Reference \[7.9\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-pagination.html)**

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [November 11, 2020, 1:42pm UTC](https://discuss.elastic.co/t/curl-output-is-not-complete/255048/3 "2020-11-11T13:42:52Z")

</div>

Hi David

Thank your for this response and page.

I have been through this page ... it does return cursor as mentioned

```auto
{
  "columns" : [
    {
      "name" : "userId",
      "type" : "text"
    }
  ],
  "rows" : [
    [
      "d1527400b8574961b1eb52a37699a42f"
    ],
    [
      "d1527400b8574961b1eb52a37699a42f"
    ],
    [
      "cd83f0a14683405fa22ca5907e9db90b"
    ],
    [
      "d1527400b8574961b1eb52a37699a42f"
    ],
    [
      "7a971150d09e43f0a5a3097010ee13fc"
    ]
  ],
  "cursor" : "o5GwAwFaAXOMA0ZHbHVZMngxWkdWZlkyOXVkR1Y0ZEY5MWRXbGtEbkYxWlhKNVZHaGxia1psZEdOb0JSUlBaakpIZEROVlFuVkJPRWRMV0hKcFRIRlVaZ0FBQUFBQUNuWTBGaTFhYVZWb1QwTnFVbUl0UlVWalUweHZhbG8wV1ZFVVQxQXlSM1F6VlVKMVFUaEhTMWh5YVV4eFZHWUFBQUFBQUFwMk14WXRXbWxWYUU5RGFsSmlMVVZGWTFOTWIycGFORmxSRkU5Zk1rZDBNMVZDZFVFNFIwdFljbWxNY1ZSbUFBQUFBQUFLZGpZV0xWcHBWV2hQUTJwU1lpMUZSV05UVEc5cVdqUlpVUlJQZGpKSGRETlZRblZCT0VkTFdISnBUSEZVWmdBQUFBQUFDblkxRmkxYWFWVm9UME5xVW1JdFJVVmpVMHh2YWxvMFdWRVVVRkF5UjNRelZVSjFRVGhIUzFoeWFVeHhWR1lBQUFBQUFBcDJOeFl0V21sVmFFOURhbEppTFVWRlkxTk1iMnBhTkZsUv////8PAQFmBnVzZXJJZAEGdXNlcklkAQR0ZXh0AAAAAQE="
}

```

I am using CURL command in my automation script.

How to get this cursor dynamically useful to have all records when I am implementing automation using scripts.

Also this is useful only when you are using format as JSON and not as txt.

I am in need to implement the output in serially so that i can use it for my further processing ...  
Thanks  
Tushar Nemade

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [November 11, 2020, 3:34pm UTC](https://discuss.elastic.co/t/curl-output-is-not-complete/255048/4 "2020-11-11T15:34:43Z")

</div>

Hi

As of now i m trying using elasticsearch-sql-cli to get the result...

Lets see if i succeed in my achievement , will share in here entire steps and methodology ...

Thanks  
Tushar Nemade

---

<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:** [November 12, 2020, 2:22pm UTC](https://discuss.elastic.co/t/curl-output-is-not-complete/255048/5 "2020-11-12T14:22:27Z")

</div>

Call again the same api with the cursor you got and get the next records until it's done.

---

<div class="post-metadata">

**Author:** ![tusharnemade](https://avatars.discourse-cdn.com/v4/letter/t/67e7ee/32.png) [@tusharnemade](https://discuss.elastic.co/u/tusharnemade)\
**Post date:** [November 15, 2020, 1:33pm UTC](https://discuss.elastic.co/t/curl-output-is-not-complete/255048/6 "2020-11-15T13:33:27Z")

</div>

This is helpful is I am doing it manually.

How could i get this Cursor value automatically in my script, which will be executing without human intervention.

---

<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:** [November 15, 2020, 5:33pm UTC](https://discuss.elastic.co/t/curl-output-is-not-complete/255048/7 "2020-11-15T17:33:36Z")

</div>

The first call to the API gives it back, right?

---

<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:** [December 13, 2020, 5:33pm UTC](https://discuss.elastic.co/t/curl-output-is-not-complete/255048/8 "2020-12-13T17:33:44Z")

</div>

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