This is a parser for logs generated by iptables and Tripwire. You can use it if you want to process your logs eg. from incommnig connection attempts.
go get github.com/JojiiOfficial/Iptables-log-parser
Reading the file ("/var/log/Tripwire21") line by line, parse it and use it as LogEntry object.
err := ParseFileByLines("/var/log/Tripwire21", func(log *LogEntry) {
//This callback gets fired for each logEntry in the given file
fmt.Println(log)
})
if err != nil {
panic(err)
}
...or use an array
logs, err := ParseFile("/var/log/Tripwire21")
if err != nil {
panic(err)
}
for _, log := range logs {
fmt.Println(log)
}