Overview
- HAProxy logs are sent directly to Fluent Bit over UDP (syslog)
- Fluent Bit extracts fields (like source IP and HTTP status)
- Lua script transforms log into a JSON payload
- Fluent Bit posts the data to OneFirewallβs API
1. Folder Structure
2. HAProxy Configuration
haproxy.cfg
3. Fluent Bit Parser
parsers.conf
4. Lua Script for Transformation
send_to_onefirewall.lua
5. Fluent Bit Configuration
fluent-bit.conf
6. Docker Compose Example
Ensure both containers are on the same network (Docker Compose does this by default).
7. OneFirewall Traffic Validation
When Fluent Bit sends structured traffic data to OneFirewall:- OneFirewall validates
src_ip
anddst_ip
fields - Invalid or private IPs are rejected with:
- Ensure youβre using valid public IPv4 addresses for testing.
β Result
With this setup:- HAProxy sends logs over UDP to Fluent Bit
- Fluent Bit parses and transforms the data with Lua
- JSON is posted to OneFirewallβs traffic validation API
π Notes
- Replace
YOUR_TOKEN_HERE
with your actual OneFirewall token - Consider adding retry/failure handling or S3 backup for production
- Ensure
dst_ip
is not a private/local IP unless OneFirewall allows it