# Kibana 4 and JSON queries

**URL:** <https://discuss.elastic.co/t/kibana-4-and-json-queries/23191>\
**Category:** Elasticsearch\
**Created:** [April 10, 2015, 5:06pm UTC](https://discuss.elastic.co/t/kibana-4-and-json-queries/23191 "2015-04-10T17:06:04Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![Marshall\_Dyer](https://avatars.discourse-cdn.com/v4/letter/m/35a633/32.png) [@Marshall\_Dyer](https://discuss.elastic.co/u/Marshall_Dyer)\
**Post date:** [April 10, 2015, 5:06pm UTC](https://discuss.elastic.co/t/kibana-4-and-json-queries/23191/1 "2015-04-10T17:06:04Z")

</div>

I’m new to elasticsearch and just trying to get started with kibana.  
I am trying to use a raw json query to query my data in kibana 4. I read  
that this is possible after a great deal of searching  
([https://github.com/elastic/kibana/issues/770](https://github.com/elastic/kibana/issues/770)), but nowhere could I find a  
tutorial on how to actually enter (or format) the json query into kibana.  
If I copy my query and paste it into the Discover page’s query bar, I am  
given an error: “query malformed, no field after start object.” The same  
thing happens if I use “Elasticsearch request body” from a working  
visualization on a dashboard, pasted verbatim.  
Here is a normal query which I can run through curl or Sense:  
GET /\_count  
{  
"query": {  
"match\_all": {}  
}  
}

But putting this into Kibana, either verbatim or without the GET /\_count as  
only:

{  
"query": {  
"match\_all": {}  
}  
}

yields the same error.  
Specifically I am trying to get this query working so I can visualize it:  
GET /my\_data/events/\_search?search\_type=count  
{  
"aggs": {  
"events": {  
"date\_histogram": {  
"field": "all\_dates",  
"interval": "month",  
"format": "yyyy-MM-dd",  
"min\_doc\_count": 0,  
"extended\_bounds": {  
"min": "2014-01-1",  
"max": "2014-12-31"  
}

```
  }
}

```

}

}

Any help would be appreciated.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/ae1ac49f-2faf-4f1c-827e-6a0a1ae3f5c1%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/ae1ac49f-2faf-4f1c-827e-6a0a1ae3f5c1%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<div class="post-metadata">

**Author:** ![Akudva](https://avatars.discourse-cdn.com/v4/letter/a/e56c9b/32.png) [@Akudva](https://discuss.elastic.co/u/Akudva)\
**Post date:** [April 10, 2015, 5:29pm UTC](https://discuss.elastic.co/t/kibana-4-and-json-queries/23191/2 "2015-04-10T17:29:00Z")

</div>

@Marshall

Even I am facing the same issue with json queries in Kibana.  
Let me know if you were able to find a solution.

I tried entering a json query into the "json input box" on the  
Visualization field within X-axis aggregation. But it did not work there.  
Hoping that someone might be able to answer!

-Ashish

On Friday, April 10, 2015 at 12:06:04 PM UTC-5, Marshall Dyer wrote:

> I’m new to elasticsearch and just trying to get started with kibana.  
> I am trying to use a raw json query to query my data in kibana 4. I read  
> that this is possible after a great deal of searching (  
> [Support Query DSL in queries and filters · Issue #770 · elastic/kibana · GitHub](https://github.com/elastic/kibana/issues/770)), but nowhere could I find a  
> tutorial on how to actually enter (or format) the json query into kibana.  
> If I copy my query and paste it into the Discover page’s query bar, I am  
> given an error: “query malformed, no field after start object.” The same  
> thing happens if I use “Elasticsearch request body” from a working  
> visualization on a dashboard, pasted verbatim.  
> Here is a normal query which I can run through curl or Sense:  
> GET /\_count  
> {  
> "query": {  
> "match\_all": {}  
> }  
> }
> 
> But putting this into Kibana, either verbatim or without the GET /\_count  
> as only:
> 
> {  
> "query": {  
> "match\_all": {}  
> }  
> }
> 
> yields the same error.  
> Specifically I am trying to get this query working so I can visualize it:  
> GET /my\_data/events/\_search?search\_type=count  
> {  
> "aggs": {  
> "events": {  
> "date\_histogram": {  
> "field": "all\_dates",  
> "interval": "month",  
> "format": "yyyy-MM-dd",  
> "min\_doc\_count": 0,  
> "extended\_bounds": {  
> "min": "2014-01-1",  
> "max": "2014-12-31"  
> }
> 
> ```
> }
> }
> 
> ```
> 
> }
> 
> }
> 
> Any help would be appreciated.

--  
You received this message because you are subscribed to the Google Groups "elasticsearch" group.  
To unsubscribe from this group and stop receiving emails from it, send an email to [elasticsearch+unsubscribe@googlegroups.com](mailto:elasticsearch+unsubscribe@googlegroups.com).  
To view this discussion on the web visit [https://groups.google.com/d/msgid/elasticsearch/bf60cb74-0c60-4c35-938f-f75acfc0051c%40googlegroups.com](https://groups.google.com/d/msgid/elasticsearch/bf60cb74-0c60-4c35-938f-f75acfc0051c%40googlegroups.com).  
For more options, visit [https://groups.google.com/d/optout](https://groups.google.com/d/optout).

---

<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, 12:20am UTC](https://discuss.elastic.co/t/kibana-4-and-json-queries/23191/3 "2017-07-06T00:20:19Z")

</div>


