An open API service indexing awesome lists of open source software.

https://github.com/jojiiofficial/iptables-log-parser

A parser for logs generated by iptables and Tripwire
https://github.com/jojiiofficial/iptables-log-parser

golang-library iptables iptables-logs parser-library

Last synced: 4 months ago
JSON representation

A parser for logs generated by iptables and Tripwire

Awesome Lists containing this project

README

          

# Iptables-log-parser
This is a parser for logs generated by [iptables](https://wiki.archlinux.org/index.php/Iptables) and [Tripwire](https://github.com/JojiiOfficial/Tripwire).
You can use it if you want to process your logs eg. from incommnig connection attempts.

# Install

```
go get github.com/JojiiOfficial/Iptables-log-parser
```

# Examples

Reading the file ("/var/log/Tripwire21") line by line, parse it and use it as LogEntry object.
```Go
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
```Go
logs, err := ParseFile("/var/log/Tripwire21")
if err != nil {
panic(err)
}
for _, log := range logs {
fmt.Println(log)
}
```