package main

import (
	"fmt"
	"log"
	"net"
)

func main() {
	conn, err := net.ListenPacket("unixgram", "/tmp/rsyslog.sock")
	if err != nil {
		log.Fatal(err)
	}
	buffer := make([]byte, 16384)
	for {
		n, _, err := conn.ReadFrom(buffer)
		if err != nil {
			break
		}
		fmt.Println(string(buffer[:n]))
	}
}
