Home

Awesome

<img src="https://github.com/loggie-io/loggie/blob/main/logo/loggie-draw.png" width="250">

go.dev reference CII Best Practices dockerHub

English | 中文

Loggie is a lightweight, high-performance, cloud-native agent and aggregator based on Golang.

Based on Loggie, we can build a cloud-native scalable log data platform.

Features

Next-generation cloud-native log collection and transmission

Building pipelines based on CRD

Loggie includes LogConfig/ClusterLogConfig/Interceptor/Sink CRDs, allowing for the creation of data collection, transfer, processing, and sending pipelines through simple YAML file creation.

eg:

apiVersion: loggie.io/v1beta1
kind: LogConfig
metadata:
  name: tomcat
  namespace: default
spec:
  selector:
    type: pod
    labelSelector:
      app: tomcat
  pipeline:
    sources: |
      - type: file
        name: common
        paths:
          - stdout
          - /usr/local/tomcat/logs/*.log
    sinkRef: default
    interceptorRef: default

crd-usage

Multiple architectures

But regardless of the deployment architecture, Loggie still maintains a simple and intuitive internal design.

High Performance

Benchmark

Configure Filebeat and Loggie to collect logs, and send them to a Kafka topic without using client compression, with the Kafka topic partition configured as 3.

With sufficient resources for the Agent specification, modify the number of files collected, the concurrency of the sending client (configure Filebeat worker and Loggie parallelism), and observe their respective CPU, memory, and pod network card transmission rates.

AgentFile SizeFile CountSink ConcurrencyCPUMEM (rss)Transmission Rates
Filebeat3.2G137.5~8.5c63.8MiB75.9MiB/s
Filebeat3.2G1810c65MiB70MiB/s
Filebeat3.2G10811c65MiB80MiB/s
Loggie3.2G132.1c60MiB120MiB/s
Loggie3.2G182.4c68.7MiB120MiB/s
Loggie3.2G1083.5c70MiB210MiB/s

Adaptive Sink Concurrency

With sink concurrency configuration enabled, Loggie can:

Lightweight Streaming Data Analysis and Monitoring

Logs are a universal data type and are not related to platforms or systems. How to better utilize this data is the core capability that Loggie focuses on and develops.

Real-time parsing and transformation

With the configuration of transformer interceptors and the configuration of functional actions, Loggie can achieve:

eg:

interceptors:
  - type: transformer
    actions:
      - action: regex(body)
        pattern: (?<ip>\S+) (?<id>\S+) (?<u>\S+) (?<time>\[.*?\]) (?<url>\".*?\") (?<status>\S+) (?<size>\S+)
      - if: equal(status, 404)
        then:
          - action: add(topic, not_found)
          - action: return()
      - if: equal(status, 500)
        then:
          - action: dropEvent()

Detection, recognition, and alerting

Helps you quickly detect potential problems and anomalies in the data and issue timely alerts. Support custom webhooks to connect to various alert channels.

Supports matching methods such as:

Log data aggregation and monitoring

Often, metric data is not only exposed through prometheus exporters, but log data itself can also provide a source of metrics. For example, by counting the access logs of a gateway, you can calculate the number of 5xx or 4xx status codes within a certain time interval, aggregate the qps of a certain interface, and calculate the total amount of body data, etc.

eg:

- type: aggregator
  interval: 1m
  select:
    # operator:COUNT/COUNT-DISTINCT/SUM/AVG/MAX/MIN
    - {key: amount, operator: SUM, as: amount_total}
    - {key: quantity, operator: SUM, as: qty_total}
  groupBy: ["city"]
  calculate:
    - {expression: " ${amount_total} / ${qty_total} ", as: avg_amount}

Observability and fast troubleshooting

FAQs

Loggie vs Filebeat/Fluentd/Logstash/Flume

LoggieFilebeatFluentdLogstashFlume
LanguageGolangGolangRubyJRubyJava
Multiple Pipelinessingle queuesingle queue
Multiple outputone outputcopy
Aggregator
Log Alarm
Kubernetes container log collectionsupport container stdout and logs files in containerstdoutstdout
Configuration deliverythrough CRDmanualmanualmanualmanual
Monitoringsupport Prometheus metrics,and can be configured to output indicator log files separately, sending metrics, etc.prometheus metricsneed exporterneed exporter
Resource Usagelowlowaveragehighhigh

Documentation

Setup

User Guide

Reference

RoadMap

RoadMap 2023

License

Apache-2.0

Contributions

Pull requests, comments and suggestions are welcome.

Please see CONTRIBUTING.md for more information.