A Go application that collects logs from syslog and webhook sources and forwards them to Kafka.
- Multiple syslog servers support (UDP/TCP)
- Multiple webhook endpoints support (HTTP/HTTPS)
- Multiple Kafka instances support
The application is configured using a YAML file. Here's an example configuration:
kafka:
- id: kafka1
brokers:
- localhost:9092
topic: logs
key:
field: timestamp
type: timestamp
syslog:
- listen: 0.0.0.0:514
format: json
protocol: udp
kafka_id: kafka1
webhook:
- listen: http://0.0.0.0:8080
path: /webhook
kafka_id: kafka1
tls:
enabled: false
id
: Unique identifier for the Kafka instancebrokers
: List of Kafka broker addressestopic
: Kafka topic to send messages tokey
: Optional message key configurationfield
: JSON field to use as message keytype
: Key type (string, number, timestamp)
listen
: Address to listen on (e.g., "0.0.0.0:514")format
: Message format (e.g., "json")protocol
: Transport protocol (udp/tcp)kafka_id
: ID of the Kafka instance to use
listen
: HTTP(S) address to listen onpath
: Webhook endpoint pathkafka_id
: ID of the Kafka instance to usetls
: Optional TLS configuration for HTTPSenabled
: Enable TLScert_file
: Path to certificate filekey_file
: Path to private key file
- Build the application:
go build
-
Create a configuration file (config.yaml)
-
Run the application:
./syslog_webhook_to_kafka
Run the test suite:
go test ./...
MIT License