# Logstash: query parameter lower than a value through elasticsearch plugin

**URL:** <https://discuss.elastic.co/t/logstash-query-parameter-lower-than-a-value-through-elasticsearch-plugin/52755>\
**Category:** Logstash\
**Created:** [June 14, 2016, 3:29pm UTC](https://discuss.elastic.co/t/logstash-query-parameter-lower-than-a-value-through-elasticsearch-plugin/52755 "2016-06-14T15:29:47Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![sen](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sen](https://discuss.elastic.co/u/sen)\
**Post date:** [June 14, 2016, 3:29pm UTC](https://discuss.elastic.co/t/logstash-query-parameter-lower-than-a-value-through-elasticsearch-plugin/52755/1 "2016-06-14T15:29:47Z")

</div>

Hello everyone,

With executing searches, I know that if I want to query a pamareter lower than a certain value i have to execute the following script:  
{"query": {  
"bool": {  
"must": [  
{  
"range": {  
"length": {  
"lte": "22"  
}  
}  
}  
]  
}  
}  
}

However, i want to do the same thing through the elastic plugin in logstash.  
elasticsearch{  
query =\>= "...."  
}

But I didn't find how to do that. (and the website doesn't give any help [https://www.elastic.co/guide/en/logstash/current/plugins-filters-elasticsearch.html](https://www.elastic.co/guide/en/logstash/current/plugins-filters-elasticsearch.html))

Thank you for your attention and your help.

S

---

<div class="post-metadata">

**Author:** ![sen](https://avatars.discourse-cdn.com/v4/letter/s/cc9497/32.png) [@sen](https://discuss.elastic.co/u/sen)\
**Post date:** [June 14, 2016, 4:23pm UTC](https://discuss.elastic.co/t/logstash-query-parameter-lower-than-a-value-through-elasticsearch-plugin/52755/2 "2016-06-14T16:23:29Z")

</div>

Using the query string query syntax ([https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax](https://www.elastic.co/guide/en/elasticsearch/reference/current/query-dsl-query-string-query.html#query-string-syntax)), I can do it like this

elasticsearch{  
query =\>= "length:{\* TO 22]"  
}

---

<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 6, 2017, 4:53am UTC](https://discuss.elastic.co/t/logstash-query-parameter-lower-than-a-value-through-elasticsearch-plugin/52755/3 "2017-07-06T04:53:03Z")

</div>

Closed on July 6, 2017, 4:53am UTC


