Hello.
I'm using logstash as a pipeline between my csv file and elasticsearch.
The csv file looks like this:
student1,90,80,85,95
student2,50,60,55,100
student3,40,70,50,60
Therefore in my kibana index "student" there are three documents one for each student and each student has the following fields:
studentname,test1,test2,test3,test4
I'm trying to use Kibana to archieve this:
Any suggestion on how to use kibana for this? or do I have the wrong data structure?
Any feedback in appreciated.
Hi George,
that should be fine. but it depends how you modeled your documents in Elasticsearch:
- you have 3 documents (one doc for each student), each document with 4 fields (one for each test).
Even though it looks the simplest, ES is not a spreadsheet. So this won't work. The aggregation framework is not build for this.
- the canonical way of doing this in Elasticsearch would be to denormalize your data, and have a separate document for each student and test combo. You'd have 12 documents. Each document would have a
student-field, a testid field and a testscore field.
Then you can just do two nested "Terms aggregation", once on testid, which you can map to the X-axis, and once on student, which you use to split the series . On the Y-axis you plot the computed metric, in this case the (average) score per student.
It's easier to think of Elasticsearch as storing a collection of measurements (sensor data, log data, ...). A test-score is basically a measurement for the tuple {student, testid}.