forecho / graylog-docker

graylog docker

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

graylog-docker

Install

Install Docker

sudo curl -sSL https://get.docker.com/ | sh
sudo curl -L https://github.com/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

**版安装

sudo curl -sSL https://get.daocloud.io/docker | sh
sudo curl -sSL https://get.daocloud.io/daotools/set_mirror.sh | sh -s http://d52bcda9.m.daocloud.io
sudo curl -L https://get.daocloud.io/docker/compose/releases/download/1.25.4/docker-compose-`uname -s`-`uname -m` -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
docker-compose --version

换**源

vim /etc/docker/daemon.json

添加代码:

{
    "registry-mirrors": [
        "https://dockerhub.azk8s.cn",
        "https://docker.mirrors.ustc.edu.cn"
    ]
}

重启服务

sudo systemctl daemon-reload && sudo systemctl restart docker

Clone Code

git clone https://github.com/forecho/graylog-docker.git
cd graylog-docker 

Config env

cp .env.example .env

change config

  • GRAYLOG_PASSWORD_SECRET: This field is used to encrypt Graylog passwords. Must be at least 16 characters.
  • GRAYLOG_ROOT_PASSWORD_SHA2: This is a SHA2 hash of the password for the admin user (above, the hash is for the password “admin”). You can generate your own password hash with the following command:
echo -n "Enter Password: " && head -1 </dev/stdin | tr -d '\n' | sha256sum | cut -d" " -f1
  • GRAYLOG_HTTP_EXTERNAL_URI: The public URI of Graylog which will be used by the web interface to communicate with the Graylog REST API.

Install Graylog

sudo docker-compose up -d

Finally access GRAYLOG_HTTP_EXTERNAL_URI through the browser, local default http://127.0.0.1:9000/

Test

echo '{"version": "1.1","host":"example.org","short_message":"A short message that helps you identify what is going on","full_message":"Backtrace here\n\nmore stuff","level":1,"_user_id":9001,"_some_info":"foo","_some_env_var":"bar"}' | gzip | nc -u -w 1 127.0.0.1 12201

Link

About

graylog docker

License:MIT License


Languages

Language:Shell 100.0%