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
- Host: GitHub
- URL: https://github.com/jojiiofficial/iptables-log-parser
- Owner: JojiiOfficial
- License: mit
- Created: 2019-10-25T12:52:05.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2019-12-15T22:41:45.000Z (about 6 years ago)
- Last Synced: 2024-06-21T03:14:01.168Z (over 1 year ago)
- Topics: golang-library, iptables, iptables-logs, parser-library
- Language: Go
- Size: 14.6 KB
- Stars: 3
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
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)
}
```