Skip to content

Commit 3fe291d

Browse files
committed
Initial import
1 parent 7582286 commit 3fe291d

File tree

5 files changed

+85
-1
lines changed

5 files changed

+85
-1
lines changed

.github/dependabot.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
version: 2
2+
updates:
3+
- package-ecosystem: "github-actions"
4+
directory: "/"
5+
schedule:
6+
interval: monthly

.github/workflows/logstash.yml

Lines changed: 40 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,40 @@
1+
---
2+
name: Logstash Syntax
3+
on:
4+
push:
5+
tags:
6+
- v*
7+
branches:
8+
- main
9+
pull_request:
10+
merge_group:
11+
12+
jobs:
13+
build:
14+
runs-on: ubuntu-latest
15+
16+
strategy:
17+
fail-fast: true
18+
max-parallel: 2
19+
matrix:
20+
release:
21+
- 7
22+
- 8
23+
24+
steps:
25+
- name: Check out code
26+
uses: actions/checkout@v4
27+
28+
- name: Install dependencies
29+
run: |
30+
sudo apt-get update
31+
sudo apt-get install gpg
32+
wget -qO - https://artifacts.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
33+
echo "deb https://artifacts.elastic.co/packages/${{ matrix.release }}.x/apt stable main" | sudo tee /etc/apt/sources.list.d/elastic-${{ matrix.release }}.x.list
34+
sudo apt-get update
35+
sudo apt-get install logstash
36+
mkdir -p /tmp/logstash/data /tmp/logstash/logs
37+
38+
- name: Test with Logstash
39+
run: |
40+
/usr/share/logstash/bin/logstash --path.settings /etc/logstash/ --path.config '*conf' --path.data /tmp/logstash/data --path.logs /tmp/logstash/logs --config.test_and_exit

.gitignore

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
input.conf
2+
output.conf

README.md

Lines changed: 25 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,2 +1,26 @@
11
# iptables-logstash-pipeline
2-
Logstash pipeline to parse iptables logs
2+
Ready made code to parse logs from iptables
3+
4+
## Input and Output ##
5+
6+
This pipeline does not provide inputs or outputs so you can configure whatever you need. Files named `input.conf` and `output.conf` will not interfere with updates via git, so name your files accordingly.
7+
8+
Here are examples how your files could look if you want to use a local Redis instance.
9+
10+
```
11+
input {
12+
redis {
13+
host => localhost
14+
key => "iptables"
15+
data_type => list
16+
}
17+
}
18+
19+
output {
20+
redis {
21+
key => "forwarder"
22+
data_type => list
23+
host => localhost
24+
}
25+
}
26+
```

filter-10-iptables.conf

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
filter {
2+
3+
kv {
4+
target => "iptables"
5+
}
6+
7+
grok {
8+
match => ["message","^%{DATA:[iptables][prefix]} IN="]
9+
tag_on_failure => ["_grokparsefailure","iptables_failed"]
10+
}
11+
12+
}

0 commit comments

Comments
 (0)