# Logstash http\_poller body calls the SQL API of elasticsearch error

**URL:** https://discuss.elastic.co/t/logstash-http-poller-body-calls-the-sql-api-of-elasticsearch-error/282042
**Category:** Logstash
**Created:** [August 20, 2021, 7:14am UTC](https://discuss.elastic.co/t/logstash-http-poller-body-calls-the-sql-api-of-elasticsearch-error/282042 "2021-08-20T07:14:48Z")
**Posts on this page:** 2
**Page:** 1

<div class="post-metadata">

### Author: ![zhyp](https://avatars.discourse-cdn.com/v4/letter/z/91b2a8/32.png) [@zhyp](https://discuss.elastic.co/u/zhyp)
#### Post date: [August 20, 2021, 7:14am UTC](https://discuss.elastic.co/t/logstash-http-poller-body-calls-the-sql-api-of-elasticsearch-error/282042/1 "2021-08-20T07:14:48Z")

</div>

Hi  
I used logstash http\_ poller calls the SQL API of elasticsearch. SQL API \_sql?format=txt error.  
The following is some configuration information.  
input {  
http\_poller {  
urls =\> {  
item =\> {  
method =\> post  
url =\> "[http://localhost:9205/\_sql?format=txt](http://localhost:9205/_sql?format=txt)"  
body =\> '{"query": "SELECT \* FROM test"}'  
headers =\> {  
Accept =\> "text/plain"  
"content-type" =\> "text/plain"  
}  
}  
}  
schedule =\> { cron =\> "\*/2 \* \* \* \* \*"}  
}  
}  
The following is the error message.  
{  
"@version" =\> "1",  
"error" =\> "Content-Type header [text/plain] is not supported",  
"status" =\> 406,  
"@timestamp" =\> 2021-08-20T07:13:58.257Z  
}

---

<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: [September 17, 2021, 7:15am UTC](https://discuss.elastic.co/t/logstash-http-poller-body-calls-the-sql-api-of-elasticsearch-error/282042/2 "2021-09-17T07:15:14Z")

</div>

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