| name | implementing-log-forwarding-with-fluentd |
| description | Configure Fluentd and Fluent Bit for centralized log aggregation, routing, filtering, and enrichment across distributed infrastructure. Use when configureing fluentd and fluent bit for centralized log aggregation, routing,. |
| domain | cybersecurity |
| subdomain | security-operations |
| tags | ["fluentd","fluent-bit","log-aggregation","log-forwarding","siem","centralized-logging","observability"] |
| version | 1.0 |
| author | oyi77 |
| license | Apache-2.0 |
| nist_csf | ["DE.CM-01","RS.MA-01","GV.OV-01","DE.AE-02"] |
Implementing Log Forwarding with Fluentd
Overview
This skill covers configuring Fluentd and Fluent Bit for centralized log collection, routing, and enrichment. Fluent Bit acts as a lightweight log forwarder on endpoints, while Fluentd serves as the central aggregator and processor. The configuration covers input plugins for syslog, file tailing, and application logs, with output routing to Elasticsearch, S3, and Splunk.
When to Use
Trigger phrases:
-
"implementing log forwarding with fluentd"
-
"Configure Fluentd and Fluent Bit for centralized log aggregation, routing, filte"
-
When deploying or configuring implementing log forwarding with fluentd capabilities in your environment
-
When establishing security controls aligned to compliance requirements
-
When building or improving security architecture for this domain
-
When conducting security assessments that require this implementation
Prerequisites
- Fluentd (td-agent) v1.16+ or Fluent Bit v3.0+
- Python 3.8+ with fluent-logger library
- Elasticsearch or Splunk for log destination
- Network access on port 24224 (Fluentd forward protocol)
- Ruby 2.7+ (for Fluentd plugin development)
Steps
import re
IOC_PATTERNS = {
"ip": r"\b(?:\d{1,3}\.){3}\d{1,3}\b",
"domain": r"\b[a-z0-9-]+\.[a-z]{2,}\b",
"hash_md5": r"\b[a-f0-9]{32}\b",
"hash_sha256": r"\b[a-f0-9]{64}\b",
}
def extract_iocs(text: str) -> dict:
return {k: re.findall(v, text) for k, v in IOC_PATTERNS.items()}
- Generate Fluent Bit Configuration — Create input, filter, and output configuration for endpoint log collection
- Generate Fluentd Aggregator Configuration — Configure the central Fluentd instance with forward input, parsing, and multi-output routing