- feat(observability): metrics server with /metrics and /health endpoints - feat(observability): correlation metrics (events, success/failed, reasons, buffers) - feat(correlation): IP exclusion filter (exact IPs and CIDR ranges) - feat(correlation): pending orphan delay for late-arriving B events - fix(stdout): sink is now a no-op for data; JSON must never appear on stdout - fix(clickhouse): all flush errors were silently discarded, now properly logged - fix(clickhouse): buffer overflow with DropOnOverflow now logged at WARN - fix(clickhouse): retry attempts logged at WARN with attempt/delay/error context - feat(clickhouse): connection success logged at INFO, batch sends at DEBUG - feat(clickhouse): SetLogger() for external logger injection - test(stdout): assert stdout remains empty for correlated and orphan logs - chore(rpm): bump version to 1.1.11, update changelog - docs: README and architecture.yml updated Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
85 lines
2.4 KiB
YAML
85 lines
2.4 KiB
YAML
# logcorrelator configuration file
|
|
# Format: YAML
|
|
|
|
# Logging configuration
|
|
log:
|
|
level: INFO # DEBUG, INFO, WARN, ERROR
|
|
|
|
inputs:
|
|
unix_sockets:
|
|
- name: http
|
|
source_type: A
|
|
path: /var/run/logcorrelator/http.socket
|
|
format: json
|
|
socket_permissions: "0666" # world read/write
|
|
- name: network
|
|
source_type: B
|
|
path: /var/run/logcorrelator/network.socket
|
|
format: json
|
|
socket_permissions: "0666"
|
|
|
|
outputs:
|
|
file:
|
|
enabled: true
|
|
path: /var/log/logcorrelator/correlated.log
|
|
|
|
clickhouse:
|
|
enabled: false
|
|
dsn: clickhouse://user:pass@localhost:9000/db
|
|
table: correlated_logs_http_network
|
|
batch_size: 500
|
|
flush_interval_ms: 200
|
|
max_buffer_size: 5000
|
|
drop_on_overflow: true
|
|
async_insert: true
|
|
timeout_ms: 1000
|
|
|
|
stdout:
|
|
enabled: false
|
|
level: INFO # DEBUG: all logs including orphans, INFO: only correlated, WARN: correlated only, ERROR: none
|
|
|
|
correlation:
|
|
# Time window for correlation (A and B must be within this window)
|
|
# Increased to 10s to support HTTP Keep-Alive scenarios
|
|
time_window:
|
|
value: 10
|
|
unit: s
|
|
|
|
# Orphan policy: what to do when no match is found
|
|
orphan_policy:
|
|
apache_always_emit: true # Always emit A events, even without B match
|
|
apache_emit_delay_ms: 500 # Wait 500ms before emitting as orphan (allows B to arrive)
|
|
network_emit: false # Never emit B events alone
|
|
|
|
# Matching mode: one_to_one or one_to_many (Keep-Alive)
|
|
matching:
|
|
mode: one_to_many
|
|
|
|
# Buffer limits (max events in memory)
|
|
buffers:
|
|
max_http_items: 10000
|
|
max_network_items: 20000
|
|
|
|
# TTL for network events (source B)
|
|
# Increased to 120s to support long-lived HTTP Keep-Alive sessions
|
|
ttl:
|
|
network_ttl_s: 120
|
|
|
|
# Exclude specific source IPs or CIDR ranges from correlation
|
|
# Events from these IPs will be silently dropped (not correlated, not emitted)
|
|
# Useful for excluding health checks, internal traffic, or known bad actors
|
|
exclude_source_ips:
|
|
- 10.0.0.1 # Single IP
|
|
- 192.168.1.100 # Another single IP
|
|
- 172.16.0.0/12 # CIDR range (private network)
|
|
- 10.10.10.0/24 # Another CIDR range
|
|
|
|
# Metrics server configuration (optional, for debugging/monitoring)
|
|
metrics:
|
|
enabled: false
|
|
addr: ":8080" # Address to listen on (e.g., ":8080", "localhost:8080")
|
|
# Endpoints:
|
|
# GET /metrics - Returns correlation metrics as JSON
|
|
# GET /health - Health check endpoint
|
|
|