如何在Kibana中为每个用户创建带宽使用情况汇总 [英] How to create bandwidth usage aggregation for each user in kibana

查看:158
本文介绍了如何在Kibana中为每个用户创建带宽使用情况汇总的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我想创建每个用户带宽使用情况的图表.我如何在kibana中做到这一点?我已经为每个用户发送了字节并接收了字节.

I want to create a plot/table of each user bandwidth usage. How do i do it in kibana? I have sent byte and receieved bytes for each user.

简而言之,我想要

   select users, sum(sentbyte + receievedbyte) from TABLE_NAME group by users order by users desc

基巴纳语:

更新的问题:

今天,我知道在kibana 3.X版本中不支持聚合.您必须使用kibana4.x.我使用以下形式的请求进行弹性搜索,它给出了所需的结果.但是我如何在kibana 4 beta 2中以图形形式表示它?

Today, I came to know there is no support of aggregation in kibana 3.X version. You have to use kibana 4.x. I have used the following form of request to elastic search and it gives the desired result. But how i do i represent it in the graphical form in kibana 4 beta 2?

POST logstash-2014.12.02/_search
{
  "size": 0,
  "aggs": {
    "group_by_bandwidth": {
      "terms": {
        "field": "user",
        "order": {
          "TotalBandwidth": "desc"
        }
      },
       "aggs": {
        "TotalBandwidth": {
          "sum": {
            "script" : "doc['rcvdbyte'].value + doc['sentbyte'].value"
             }
           }
         }
       }
     } 
}

推荐答案

这是我将在最新版本的Kibana 4 Beta(主版)中实现的方法:

This is how I would accomplish this in the latest build of the Kibana 4 Beta (master):

  1. 为用户总带宽设置一个脚本字段.现在,我已经将此字段称为bandwidth,使用脚本doc['rcvdbyte'].value + doc['sentbyte'].value,并将返回值设置为Number

  1. Setup a scripted field for the users total bandwidth. For now, I've called this field bandwidth, use the script doc['rcvdbyte'].value + doc['sentbyte'].value, and set the return value to Number

使用总和汇总为每个用户添加bandwidth.在我的数据集中,我没有用户,因此我正在使用clientip.

Use a sum aggregation to add up the bandwidth for each user. In my dataset I don't have users, so I'm using clientip.

虽然我的数据略有不同,但可以将这些字段换成您的数据集,并且应该可以正常工作.这些聚合也应该在其他可视化类型中起作用.

While my data is slightly different, the fields could be swapped out for your dataset and should work just fine. These aggregations should also work in other visualization types.

希望有帮助!

这篇关于如何在Kibana中为每个用户创建带宽使用情况汇总的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆