# JSON queries in Kibana cause Discover: Internal Server Error

**URL:** https://discuss.elastic.co/t/json-queries-in-kibana-cause-discover-internal-server-error/189075
**Category:** Kibana
**Created:** [July 5, 2019, 10:55am UTC](https://discuss.elastic.co/t/json-queries-in-kibana-cause-discover-internal-server-error/189075 "2019-07-05T10:55:50Z")
**Posts on this page:** 3
**Page:** 1

<div class="post-metadata">

### Author: ![werowe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/werowe/32/47523_2.png) [@werowe](https://discuss.elastic.co/u/werowe)
#### Post date: [July 5, 2019, 10:55am UTC](https://discuss.elastic.co/t/json-queries-in-kibana-cause-discover-internal-server-error/189075/1 "2019-07-05T10:55:50Z")

</div>

I cannot execute the simplest of queries in Kibana that work just fine using curl. My understanding is that you you pick Lucene query language you can use JSON.

So this query that works from curl:

> {"query":{"match":{"geoip.country\_name":"Luxembourg"}}}

Causes this error when pasted into Kibana Discovery screen:

 ![17%20PM](https://us1.discourse-cdn.com/elastic/original/3X/6/a/6a348f62b23774ff774459389c9784e2903864cb.png)

> OK  
> Error: Internal Server Error  
> SearchError@[http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/bundles/commons.bundle.js:3:298205](http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/bundles/commons.bundle.js:3:298205)  
> [http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/bundles/commons.bundle.js:4:324937](http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/bundles/commons.bundle.js:4:324937)  
> processQueue@[http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built\_assets/dlls/vendors.bundle.dll.js:427:199689](http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built_assets/dlls/vendors.bundle.dll.js:427:199689)  
> [http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built\_assets/dlls/vendors.bundle.dll.js:427:200662](http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built_assets/dlls/vendors.bundle.dll.js:427:200662)  
> $digest@[http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built\_assets/dlls/vendors.bundle.dll.js:427:210414](http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built_assets/dlls/vendors.bundle.dll.js:427:210414)  
> $apply@[http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built\_assets/dlls/vendors.bundle.dll.js:427:213226](http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built_assets/dlls/vendors.bundle.dll.js:427:213226)  
> done@[http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built\_assets/dlls/vendors.bundle.dll.js:427:132723](http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built_assets/dlls/vendors.bundle.dll.js:427:132723)  
> completeRequest@[http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built\_assets/dlls/vendors.bundle.dll.js:427:136337](http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built_assets/dlls/vendors.bundle.dll.js:427:136337)  
> requestLoaded@[http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built\_assets/dlls/vendors.bundle.dll.js:427:135240](http://ec2-35-180-186-122.eu-west-3.compute.amazonaws.com:5601/built_assets/dlls/vendors.bundle.dll.js:427:135240)

---

<div class="post-metadata">

### Author: ![lukeelmers](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/lukeelmers/32/35230_2.png) [@lukeelmers](https://discuss.elastic.co/u/lukeelmers)
#### Post date: [July 5, 2019, 9:45pm UTC](https://discuss.elastic.co/t/json-queries-in-kibana-cause-discover-internal-server-error/189075/2 "2019-07-05T21:45:33Z")

</div>

Hi @werowe,

You are correct; the query bar in Discover does accept raw query JSON when using Lucene. However, you'll just want to paste the contents of the `query: {}` object. (Discover doesn't support aggregations, so it is assumed that anything you put in the input is already going to be a `query`; best explained by [this Stack Overflow answer](https://stackoverflow.com/a/49987302)).

Try this instead:

```auto
{"match":{"geoip.country_name":"Luxembourg"}}

```

Also worth noting; if you save a filter by clicking "Add Filter" in the UI, there is an option in the `Edit Filter` popup to manipulate the query DSL directly. In that case you could include the wrapping `query: {}` object.

Hope this helps!

---

<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: [August 2, 2019, 9:52pm UTC](https://discuss.elastic.co/t/json-queries-in-kibana-cause-discover-internal-server-error/189075/3 "2019-08-02T21:52:35Z")

</div>

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