Log system architecture

Stella981
• 阅读 512

0. 技术选型参考

Log system architecture

1. Collector

Keywords: Collector, Processor

名称

Beats

Fluentd-bit

Introduction

Beats are a collector and processor of lightweight (resource efficient, no dependencies, small) and open source log shippers that act as agents installed on the different servers in your infrastructure for collecting logs or metrics.

Fluent Bit was born to address the need for a high performance and optimized tool that can collect and process data from any input source, unify that data and deliver it to multiple destinations.

Owner

Elastic

Treasure Data

Open Source

True

True

Github Stars

5742

608

License

Apache License v2.0

Apache License v2.0

Scope

Containers / Servers / K8S

Containers / Servers / K8S

Language

Go

C

Memory

~10MB

~500KB

Performance

High

High

Dependencies

Zero dependencies, unless some special plugin requires them.

Zero dependencies, unless some special plugin requires them.

Category

Auditbeat,Filebeat,Heartbeat,Metricbeat,Packetbeat,Winlogbeat

NaN

Configuration

File(.yml)/Cmd

File(custom file extension and syntax)/Cmd

Essence

Collector & Processor

Collector & Processor

Input/Module

File, Docker, Syslog, Nginx, Mysql, Postgresql, etc

File,CPU, Disk, Docker, Syslog, etc

Output

Elasticsearch, Logstash, Kafka, Redis, File, Console

ES, File, Kafka, etc

1.1 Filebeat 架构图

Log system architecture

Log system architecture

Log system architecture

  1. Ingest Node - A es plugin which pre-process documents before the actual document indexing happen and replace for Logstash. The ingest node intercepts bulk and index requests, it applies transformations, and it then passes the documents back to the index or bulk APIs. Define a pipeline(Processors) that specifies a series of processors, then register the pipeline id in Filebeat configuration file.
  2. Kafka - Prevent loss of data and manage logging output speed.

1.2 Fluent bit 架构图

Log system architecture

Name

Description

Samples

Input

Entry point of data. Implemented through Input Plugins, this interface allows to gather or receive data.

Samples

Parser

Parsers allow to convert unstructured data gathered from the Input interface into a structured one. Parsers are optional and depends on Input plugins.

Prospector and processors in Filebeat

Filter

The filtering mechanism allows to alter the data ingested by the Input plugins. Filters are implemented as plugins.

Prospector and processors in Filebeat

Buffer

By default, the data ingested by the Input plugins, resides in memory until is routed and delivered to an Output interface.

Routing

Data ingested by an Input interface is tagged, that means that a Tag is assigned and this one is used to determinate where the data should be routed based on a match rule.

Output

An output defines a destination for the data. Destinations are handled by output plugins. Note that thanks to the Routing interface, the data can be delivered to multiple destinations.

Samples

2. Log Transporter

Keywords: Collector, Processor, Aggregator

名称

Logstah

Fluentd

Introduction

Logstash is an open source, server-side data processing pipeline that ingests data from a multitude of sources simultaneously, transforms it, and then sends it to your stash.

Fluentd is an open source data collector, which lets you unify the data.

Owner

Elastic

Treasure Data

Open Source

True

True

Github Stars

9105

6489

License

Apache License v2.0

Apache License v2.0

Scope

Containers / Servers / K8S

Containers / Servers / K8S

Language

JRuby(JVM)

Ruby & C

Memory

200MB+

~40MB

Performance

Middle

High

Dependencies

JVM

Ruby Gem

Configuration

File(custom file extension and syntax)/Cmd

File(custom file extension and syntax)/Cmd

Essence

Collector, Processor, Aggregator

CCollector, Processor, Aggregator

Input/Module

Limited only by your imagination(Serilog)

Limited only by your imagination(Nlog)

Output

Limited only by your imagination

Limited only by your imagination

Further Reading: Fluentd vs. Logstash: A Comparison of Log Collectors

3. 初步总结

比较

Beats + Logstash

Fluentd bit + Fluentd

说明

功能实现

基本一致

安装与配置简易性

内存占用

JVM 特性使然

可靠性

前者使用 registry file + redis 实现可靠性,后者使用内置 buffering 实现可靠性

可扩展性

插件生态和可扩展性基本一致。后者为分布型插件管理

趋势

ELK -> EFK

其他

前者更倾向于使用 go & java 技术栈,后者有 docker, k8s 官方 log driver 类型和案例支持

Tips: 任一层级都可以自由替换.

4. Visualizer

Keywords: Query, Analyze, Monitor

名称

Kibana

Grafana

Introduction

Kibana is an open source data visualization plugin for Elasticsearch.

Data visualization & Monitoring with support for Graphite, InfluxDB, Prometheus, Elasticsearch and many more databases.The leading open source software for time series analytics.

Owner

Elastic

Grafana

Open Source

True

True

Github Stars

9k+

22k+

License

Apache License v2.0

Apache License v2.0

Scope

ElasticSearch only

ElasticSearch, InfluxDB, PostgreSQL etc

Language

Javascript

Go & Typescript

Configuration

File(.yml)/Cmd

File(custom file extension and syntax)/Cmd

Simple Query

Lucene syntax and filter components

filter components.Different from each other data source

Full-Text Query

Yes

No

Security

Plugins or libraries

Integration

Notification

Plugins or libraries

Integration

Advantages

Log, ES

Multiple data source, APM, Timeseries

Working together.

5. Log Storage and Analyzer

Keywords:Storage, ES, Postgresql, Zombodb, Arangodb

5.1 ElasticSearch

  1. 同时支持单文档的对象搜索+模糊搜索+全文搜索
  2. Skywalking 官方支持存储媒介
  3. 作为流行 Output 支持绝大部分 Log 相关系统
  4. 天生分布式
  5. 一键设置过期窗口,索引重建
  6. ……

  1. 占用资源较多,对存储介质要求高
  2. 运维成本更高
  3. 持久化
  4. 安全性 - Search Guard
  5. ……

6. 总结

  1. Sinks(Log sinks, Beats, Fluentd-bit) -> Storages(ElasticSearch, Postgresql,Zombodb etc).
  2. Collctors(Beats, Fluentd-bit) -> Kafka -> Fluentd -> Storages(ElasticSearch, Postgresql,Zombodb etc).

7. 扩展

Log system architecture Log system architecture

点赞
收藏
评论区
推荐文章
blmius blmius
2年前
MySQL:[Err] 1292 - Incorrect datetime value: ‘0000-00-00 00:00:00‘ for column ‘CREATE_TIME‘ at row 1
文章目录问题用navicat导入数据时,报错:原因这是因为当前的MySQL不支持datetime为0的情况。解决修改sql\mode:sql\mode:SQLMode定义了MySQL应支持的SQL语法、数据校验等,这样可以更容易地在不同的环境中使用MySQL。全局s
Wesley13 Wesley13
2年前
java将前端的json数组字符串转换为列表
记录下在前端通过ajax提交了一个json数组的字符串,在后端如何转换为列表。前端数据转化与请求varcontracts{id:'1',name:'yanggb合同1'},{id:'2',name:'yanggb合同2'},{id:'3',name:'yang
Jacquelyn38 Jacquelyn38
2年前
2020年前端实用代码段,为你的工作保驾护航
有空的时候,自己总结了几个代码段,在开发中也经常使用,谢谢。1、使用解构获取json数据let jsonData  id: 1,status: "OK",data: 'a', 'b';let  id, status, data: number   jsonData;console.log(id, status, number )
皕杰报表之UUID
​在我们用皕杰报表工具设计填报报表时,如何在新增行里自动增加id呢?能新增整数排序id吗?目前可以在新增行里自动增加id,但只能用uuid函数增加UUID编码,不能新增整数排序id。uuid函数说明:获取一个UUID,可以在填报表中用来创建数据ID语法:uuid()或uuid(sep)参数说明:sep布尔值,生成的uuid中是否包含分隔符'',缺省为
Stella981 Stella981
2年前
KaliTools说明书+BurpSuit实战指南+SQL注入知识库+国外渗透报告
!(https://oscimg.oschina.net/oscnet/d1c876a571bb41a7942dd9752f68632e.gif"15254461546.gif")0X00KaliLinux Tools中文说明书!(https://oscimg.oschina.net/oscnet/
Wesley13 Wesley13
2年前
mysql设置时区
mysql设置时区mysql\_query("SETtime\_zone'8:00'")ordie('时区设置失败,请联系管理员!');中国在东8区所以加8方法二:selectcount(user\_id)asdevice,CONVERT\_TZ(FROM\_UNIXTIME(reg\_time),'08:00','0
Wesley13 Wesley13
2年前
00:Java简单了解
浅谈Java之概述Java是SUN(StanfordUniversityNetwork),斯坦福大学网络公司)1995年推出的一门高级编程语言。Java是一种面向Internet的编程语言。随着Java技术在web方面的不断成熟,已经成为Web应用程序的首选开发语言。Java是简单易学,完全面向对象,安全可靠,与平台无关的编程语言。
Stella981 Stella981
2年前
Django中Admin中的一些参数配置
设置在列表中显示的字段,id为django模型默认的主键list_display('id','name','sex','profession','email','qq','phone','status','create_time')设置在列表可编辑字段list_editable
Wesley13 Wesley13
2年前
MySQL部分从库上面因为大量的临时表tmp_table造成慢查询
背景描述Time:20190124T00:08:14.70572408:00User@Host:@Id:Schema:sentrymetaLast_errno:0Killed:0Query_time:0.315758Lock_
Python进阶者 Python进阶者
3个月前
Excel中这日期老是出来00:00:00,怎么用Pandas把这个去除
大家好,我是皮皮。一、前言前几天在Python白银交流群【上海新年人】问了一个Pandas数据筛选的问题。问题如下:这日期老是出来00:00:00,怎么把这个去除。二、实现过程后来【论草莓如何成为冻干莓】给了一个思路和代码如下:pd.toexcel之前把这