简体   繁体   English

如何将sum(field)编写为Kibana中的脚本字段?

[英]How to write sum(field) as a scripted field in Kibana?

There is a way to perform simple mathematical calculations in scripted fields such as doc['A'].value+doc['B'].value . 有一种方法可以在诸如doc['A'].value+doc['B'].value脚本字段中执行简单的数学计算。 Is there a way to find sum as an aggregation like when there are 1000s of values to sum up? 有没有一种方法可以找到总和作为汇总,就像有几千个要汇总的值一样? For eg. 例如。 I want to find sum(<a_set_of_values_stored_in_one_field>) . 我想找到sum(<a_set_of_values_stored_in_one_field>) Similarly, how to find count of a certain field "count(field_name)" ? 同样,如何查找某个字段"count(field_name)"

In the Y-axis, instead of "count" chose "Sum" , then in the new window that appear, you can chose your field. 在Y轴上,选择“ Sum”而不是“ count” ,然后在出现的新窗口中选择字段。

PS: This is for sum the value of one field. PS:这是对一个字段的值求和。

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

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