forked from intelie/graylog2-plugin-output-syslog
-
Notifications
You must be signed in to change notification settings - Fork 21
/
Copy pathrun-graylog-mac
executable file
·49 lines (43 loc) · 1.48 KB
/
run-graylog-mac
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
#!/bin/bash
set -e
HERE=$PWD
VER=6.0.4
URL=https://downloads.graylog.org/releases/graylog/graylog-$VER.tgz
if [ ! -f "graylog-$VER.tgz" ]; then
echo "Downloading $URL"
curl -L -o graylog-$VER.tgz $URL
fi
if [ ! -d graylog-$VER ]; then
tar -xzvf graylog-$VER.tgz
fi
GL=$HERE/graylog-$VER
TT=$GL/tmp
mkdir -p $TT
#sudo umount $TT
#sudo mount -o bind,noexec $TT $TT
export JAVA_OPTS="-Djava.io.tmpdir=$TT"
rm -Rf $GL/data
mkdir -p $GL/data
mvn package -Dgraylog2.version=$VER -DskipTests
cp $HERE/target/graylog-output-syslog-$VER.jar $GL/plugin
export GRAYLOG_CONF=$GL/graylog.conf
#sudo sysctl -w vm.max_map_count=262144
docker rm -f elastic
docker run --name elastic -p 9200:9200 -e "discovery.type=single-node" \
-e "cluster.routing.allocation.disk.threshold_enabled=false" \
-d elasticsearch:7.10.1
docker rm -f mongo
docker run --name mongo -p 27017:27017 -d mongo:5.0
docker start elastic
docker start mongo
sleep 10
if [ ! -f $GL/graylog.conf ]; then
cp $HERE/sample-graylog.conf $GL/graylog.conf
fi
$GL/bin/graylogctl run
## Run two consoles additionally:
## Run syslog (without SSL/TLS)
## docker run -it -p 514:514/udp -p 514:514/tcp -p 601:601 --name syslog-ng --rm balabit/syslog-ng:latest
## Run syslog (with SSL/TLS)
## docker run -it -p 514:514/udp -p 514:514/tcp -p 6514:6514 -v $PWD/syslog-ng-ssl.conf:/etc/syslog-ng/syslog-ng.conf -v $PWD/testssl:/etc/syslog-ng/testssl --name syslog-ng --rm balabit/syslog-ng:latest
## docker exec syslog-ng tail -f /var/log/messages