项目作者: NDrive

项目描述 :
Archives graylog indices.
高级语言: Python
项目地址: git://github.com/NDrive/graylog-archiver.git
创建时间: 2017-03-03T14:29:54Z
项目社区:https://github.com/NDrive/graylog-archiver

开源协议:MIT License

下载


Graylog Archiver

Archives graylog indices to backup_dir, keeping the latest ones (max_indices).

For example, if you have the following indices:

  • graylog_49
  • graylog_48
  • graylog_47

And max_indices is set to 1, it will archive and delete 48 and 47.

Install

Install Python 3 and use pip:

  1. pip3 install graylog-archiver

Usage

Configure path.repo in elasticsearch.yml to allow the creation of backup
repositories at backup_dir.

Example:

  1. path.repo: /srv/backups/elasticsearch

Create a configuration file for graylog archiver graylog_archiver.json:

  1. {
  2. "elasticsearch": {
  3. "hosts": "localhost"
  4. },
  5. "max_indices": 3,
  6. "backup_dir": "/srv/backups/elasticsearch/graylog",
  7. "delete": false
  8. }

Run with:

  1. graylog-archiver

Use your strategy to backup:

  1. rsync -r --remove-source-files /srv/backups/elasticsearch/graylog backups@backups.company.com:/srv/backups/graylog

Test

Start docker containers:

  1. cd test && docker-compose up -d

Setup Graylog with an input and send some logs.

Run graylog_archiver with the test configuration:

  1. graylog-archiver --config test/config.json