Skip to content

Commit 3815364

Browse files
GDR!GDR!
authored andcommitted
Initial
1 parent 5e689b6 commit 3815364

File tree

4 files changed

+54
-0
lines changed

4 files changed

+54
-0
lines changed

Dockerfile

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
FROM sebp/elk
2+
3+
ENV ES_HOME /opt/elasticsearch
4+
WORKDIR ${ES_HOME}
5+
6+
RUN CONF_DIR=/etc/elasticsearch gosu elasticsearch bin/elasticsearch-plugin \
7+
install -b ingest-geoip
8+
9+
WORKDIR ${LOGSTASH_HOME}
10+
RUN gosu logstash bin/logstash-plugin install logstash-codec-netflow
11+
12+
ADD logstash-30-netflow.conf /etc/logstash/conf.d/30-netflow.conf
13+
ADD elk-post-hooks.sh /usr/local/bin/elk-post-hooks.sh

docker-compose.yml

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
elk:
2+
image: sebp/elk
3+
ports:
4+
- "5601:5601"
5+
- "9200:9200"
6+
- "5044:5044"
7+
- "9995:9995/udp"

elk-post-hooks.sh

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
#!/bin/sh
2+
3+
if [ -f /setup_complete ]; then
4+
exit 0
5+
fi
6+
7+
echo "Running first-run setup hooks"
8+
9+
touch /setup_complete
10+
11+
cd /opt/logstash
12+
bin/logstash --modules netflow --setup
13+
echo "Netflow module setup complete"

logstash-30-netflow.conf

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
input {
2+
udp {
3+
port => 9995
4+
type => "netflow"
5+
codec => "netflow"
6+
}
7+
}
8+
9+
filter {
10+
if [type] == "netflow" {
11+
geoip {
12+
source => "netflow.ipv4_src_addr"
13+
target => "netflow.src_geo"
14+
}
15+
geoip {
16+
source => "netflow.ipv4_dst_addr"
17+
target => "netflow.dst_geo"
18+
}
19+
}
20+
}
21+

0 commit comments

Comments
 (0)