简体   繁体   English

如何在使用聚合的kibana 4中创建脚本字段?

[英]How do I create a scripted field in kibana 4 that uses aggregation?

Kibana 4 has a new feature to add scripted fields and write custom scripts. Kibana 4具有添加脚本字段和编写自定义脚本的新功能。 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.. 我是Kibana和elasticsearch的新来者,我正在寻找一个开始的示例脚本..

Scripted fields in Kibana are powered by lucene expressions, which only support numeric operations right now. Kibana中的脚本字段由lucene表达式提供支持,该表达式目前仅支持数字操作。 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. 在路上,他们甚至可以支持诸如从日期中提取星期几或者与正则表达式匹配的字符串部分。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM