JSON input causes unknown key error


I just started working with Kibana some days ago and now I want to explore the json input field.

In a histogram I want to count the occurences of the field "test_id". Therefore I use a filter which works fine.

In addition, I want to group the test_id's by the test_name. Because there can occur different names all the time I do not want to hardcode additional filters. Therefore I thought that JSON inputs can solve my problem.

I've added the following code but I always get an error message (Unknown key for a START_OBJECT in [3]: [aggs].)

"aggs": {
"4": {
"terms": {
"field": "test_name"

Also when I created a blank histogram and added the JSON input for the filter, I get the same error message. The JSON input for the filter is

"aggs": {
"3": {
"filters": {
"filters": {
"test_id:": {
"query": {
"query_string": {
"query": "test_id:
"analyze_wildcard": true

I'm using Kibana 4.4.1 and ES 2.2.0.

Are you talking about json input field under the advanced options for each aggregation ?

you can't set filters there, you can just set additional configurations on that specific aggregation.

Yes, I was thinking that it is possible to add filters/aggregations etc. there..

Is there any other possibility to group the filtered data dynamically (to group the data returned by the filter by a field value in the ES)?

could you provide an example of what you would want to achieve ?

In my es I have a field test_data which contains test_id and test_name.

I want to create a line chart which should shows the following:

  1. The number of test_id's over time
  2. The number of test_id's grouped by test_name over time

The first part can be easily done with the count aggregation and a filter on the x- axis. But I do not know how I can achieve the second part.
I do not want to use additional filters like


because if I add a new test_name to the es I have to add another filter in kibana too.

I hope it is clear what I want to achieve.

why are you using filter in the first example ? wouldn't

  • using date histogram for your x axis (on timestamp field)
  • count metric on y axis
    do the job ?

for second example, how would you want to see your data ?
monday, group1: 345, group2, 123, group3: 453 ?

then this should do it:

  • date histogram for your x axis (timestamp field)
  • split series, terms aggregation, split on test_name field
  • count metric on your y axis

this should produce one line for each test_name

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