Kibana 4 - Visualization Question


I have a data set which includes the the medal types won by each country
along with the year they won the medal. Below is the sample data..

"_source": {

  • "message": [
    • "4183,1924-06-01,Summer,"NURMI,
      Paavo",Men,FIN,Finland,Athletics,3000m team,Gold "
  • "@version": "1",
  • "@timestamp": "2015-04-06T00:19:35.657Z",
  • "MedalistID": "4183",
  • "Year": "1924-06-01",
  • "Season": "Summer",
  • "Athlete Name": "NURMI, Paavo",
  • "Gender": "Men",
  • "NOC": "FIN",
  • "Country": "Finland",
  • "Main Sport": "Athletics",
  • "Detailed Sport": "3000m team",
  • "Medal Type": "Gold"


I am trying to build the following visualization.

Line Chart:
Filtered by Top 5 Countries (by count of rows)
Year on the X Axis
Count on the Y Axis

*Find the 5 countries with most medals over entire dataset, then plot their
results for each year

I am struggling to build this aggregation in Kibana 4. If I first select
Y-Axis as "Count" and X-Axis as "Terms Aggregation" with Top 5 Country,
then I can't plot the results per year.

And if I select Y-Axis as "Count" and X-Axis as "Date Histogram" with Year
and then add a sub-aggregation of "Terms Aggregation" with Top 5 Country,
then obviously the sub aggregation is per year and not over the entire data
set. How do I get around this problem.

I want my top level aggregation to be Top 5 Country but the results need to
be plotted per year.


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
To view this discussion on the web visit
For more options, visit