# Select statemet results in a blocked write attempt

**URL:** <https://discuss.elastic.co/t/select-statemet-results-in-a-blocked-write-attempt/265366>\
**Category:** Elasticsearch\
**Tags:** elastic-stack-sql\
**Created:** [February 24, 2021, 3:47pm UTC](https://discuss.elastic.co/t/select-statemet-results-in-a-blocked-write-attempt/265366 "2021-02-24T15:47:38Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![daniel90](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/daniel90/32/77633_2.png) [@daniel90](https://discuss.elastic.co/u/daniel90)\
**Post date:** [February 24, 2021, 3:47pm UTC](https://discuss.elastic.co/t/select-statemet-results-in-a-blocked-write-attempt/265366/1 "2021-02-24T15:47:38Z")

</div>

I tried to access data created by greylog in a elasticsearch index  
using:

> **[Mapping concepts across SQL and Elasticsearch | Elasticsearch Guide \[8.11\] |...](https://www.elastic.co/guide/en/elasticsearch/reference/current/_mapping_concepts_across_sql_and_elasticsearch.html)**

> **[Getting Started with SQL | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-getting-started.html)**

As reference i should get the contents of greylog\_10 with:

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

but that gives me:  
{"error":"Incorrect HTTP method for uri [/\_sql?format=text] and method [POST], allowed: [PUT, HEAD, GET, DELETE]","status":405}

or

> curl -X POST "localhost:9200/\_sql?format=txt&pretty" -H 'Content-Type: application/json' -d'  
> {  
> "query": "SELECT \* FROM greylog\_10"  
> }  
> '  
> And this somehow attempts to write something?  
> Response:  
> '{"error":{"root\_cause":[{"type":"cluster\_block\_exception","reason":"blocked by: [FORBIDDEN/8/index write (api)];"}],"type":"cluster\_block\_exception","reason":"blocked by: [FORBIDDEN/8/index write (api)];"},"status":403}'

How does that match up with:

> **[Getting Started with SQL | Elasticsearch Guide \[8.11\] | Elastic](https://www.elastic.co/guide/en/elasticsearch/reference/current/sql-getting-started.html)**

according to

> **[Mapping concepts across SQL and Elasticsearch | Elasticsearch Guide \[8.11\] |...](https://www.elastic.co/guide/en/elasticsearch/reference/current/_mapping_concepts_across_sql_and_elasticsearch.html)**

greylog\_10 should behave like a table in that example. And why would a SELECT statement ever write to the DB?

---

<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 24, 2021, 3:47pm UTC](https://discuss.elastic.co/t/select-statemet-results-in-a-blocked-write-attempt/265366/2 "2021-03-24T15:47:40Z")

</div>

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