Kibana 4 has a new feature to add scripted fields and write custom scripts. I wish to write a script that uses aggregations. Its easy to do simple arithmetic operations in scripted scripts but for doing aggregations I am puzzled. I am a new comer to Kibana and elasticsearch, I am looking for a sample script for beginning..
Asked
Active
Viewed 7,886 times
1 Answers
3
Scripted fields in Kibana are powered by lucene expressions, which only support numeric operations right now. Support for things like string manipulation and date parsing will probably be added at some point, but I doubt scripts will even support executing aggregations.
Scripted fields are primarily for converting a number before using it, or creating a synthetic field which is the combination of two or more other fields. Down the road they may even support things like extracting the day of the week from a date, or the portion of a string that matches a regular expression.

Spencer Alger
- 918
- 2
- 9
- 22
-
I may have misunderstood your comment regarding date extraction, but isn't this an example to the contrary? https://www.elastic.co/blog/kibana-4-beta-3-now-more-filtery – rafraf Jun 29 '15 at 07:03
-
3You're right rafraf, Beta 3 had access to Groovy scripting, but in a subsequent elasticsearch release Groovy scripting was disabled by default due to security concerns. Now Kibana uses lucene expressions, a scripting language that is secure and enabled by default in ES. – Spencer Alger Jul 01 '15 at 19:06