zoukankan      html  css  js  c++  java
  • Logstash和Flume-NG Syslog接收小测试

    目前在大规模日志处理平台中常见的日志采集器可以采用Logstash或Flume。这两种日志采集器架构设计理念基本相似,都采用采集-过滤处理-输出的方式。下面对这两种采集器Syslog接收性能做个简单测试,供大家参考。

    •  测试过程

    基本测试过程是使用2台机器,1台负责发送Syslog数据包,一台采集器。

    在采集器上分别安装ELK套件和Apache Flume 1.8.0软件。

    Logstash采集配置如下:

    input {

      udp {

       host => "0.0.0.0"

       port => "514"

       type => "syslog"

       codec => plain { charset => "UTF-8" }

      }

    }

    output {

      elasticsearch { 

          hosts => ["10.0.190.109:9200"] 

          document_type => "syslog"

      }

    }

    Flume-NG采集配置如下:

    a1.sources = r1

    a1.sinks = k1

    a1.channels = c1

    # Describe/configure the source

    a1.sources.r1.type = syslogudp

    a1.sources.r1.port = 5140

    a1.sources.r1.host = 10.0.190.109

    a1.sources.r1.channels = c1

    # Describe the sink

    a1.sinks.k1.type = file_roll

    a1.sinks.k1.channel = c1

    a1.sinks.k1.sink.directory = /opt/flumelog

    # Use a channel which buffers events in memory

    a1.channels.c1.type = memory

    a1.channels.c1.capacity = 1000

    a1.channels.c1.transactionCapacity = 100

    # Bind the source and sink to the channel

    a1.sources.r1.channels = c1

    a1.sinks.k1.channel = c1

    重点来了,从测试机连续发送Syslog数据包,连续发送1000次,多次验证测试结果可以发现:

    ELK中可以基本接收到1000条。

    Flume可以接收到并写入本地文件200到350条之间。上述两者差别主要在于Logstash接收并写入ES中,Flume接收并写入本地文件(写入ES太麻烦,Flume的ES Sink模块不兼容最新的ES版本)。

    但是把配置中a1.sources.r1.type = syslogudp改成a1.sources.r1.type = syslogtcp,在测试机发送tcp格式的syslog数据包基本可以收到1000条。

    以上只是个小小的测试,供大家参考。

  • 相关阅读:
    一般处理程序(ashx)
    添加水印
    一般处理程序(ashx)的增删改查
    ASP.NET简介
    泛型反射
    委托事件
    词法分析器作业
    代理模式
    python 之面向对象的三大特性
    python之封装
  • 原文地址:https://www.cnblogs.com/wishma/p/9888878.html
Copyright © 2011-2022 走看看