Creating custom fields in indexed records of elastic search

Hi, I have the following setup on red hat linux,

Fluentd (data collector) --> Elasticsearch (Indexing data) --> Kibana (Visualization)

Fluentd is collecting data from some resource which I want to reform. Say for example I am getting students information from fluentd like student information and marks in subjects. I want to create new fields like total marks, percentage and grade along with existing fields.

I will be using these fields in kibana to create graphs.

Where and how to create these custom fields?
Where should calculation of these fields should happen?

You can do aggregations on the data to get things like total marks, but they aren't added as fields, it's all dynamic in KB.