# Need help with Query. I use kibana sucessfully but I don't know how build my query in json

**URL:** <https://discuss.elastic.co/t/need-help-with-query-i-use-kibana-sucessfully-but-i-dont-know-how-build-my-query-in-json/99155>\
**Category:** Elasticsearch\
**Created:** [September 1, 2017, 5:16pm UTC](https://discuss.elastic.co/t/need-help-with-query-i-use-kibana-sucessfully-but-i-dont-know-how-build-my-query-in-json/99155 "2017-09-01T17:16:23Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![Benoit\_Martin](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/benoit_martin/32/21235_2.png) [@Benoit\_Martin](https://discuss.elastic.co/u/Benoit_Martin)\
**Post date:** [September 1, 2017, 5:16pm UTC](https://discuss.elastic.co/t/need-help-with-query-i-use-kibana-sucessfully-but-i-dont-know-how-build-my-query-in-json/99155/1 "2017-09-01T17:16:24Z")

</div>

Hi,

I need help to transform a query I build with Kibana (Discover)

![image](https://us1.discourse-cdn.com/elastic/original/3X/d/3/d3ff77817cafcaea435292690e4c87015e7d7d13.png)

I think I need to use bool query with some filter but I don't understand how to do that as curl of rest api call. I try and get error from elasticsearch eachtime.

```auto
 curl -XGET 'http://slpelk0675:9200/filebeat-*/log/_sear ch' -d '
> {
> "query": {
> "bool": {
> "must_not": [
> {
> "term": {
> "must_not": [
> {
> "_name": "batchman"
> }
> ]
> }
> }
> ]
> }
> }
> }
> '

```

I want to use a query like the image I add to that discussion.

Thank you!!!!

---

<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 29, 2017, 5:16pm UTC](https://discuss.elastic.co/t/need-help-with-query-i-use-kibana-sucessfully-but-i-dont-know-how-build-my-query-in-json/99155/2 "2017-09-29T17:16:24Z")

</div>

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