Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/outbrain-inc/consul-raftdb-reader
A CLI tool to read Consul's RAFT commitlog
https://github.com/outbrain-inc/consul-raftdb-reader
Last synced: 1 day ago
JSON representation
A CLI tool to read Consul's RAFT commitlog
- Host: GitHub
- URL: https://github.com/outbrain-inc/consul-raftdb-reader
- Owner: outbrain-inc
- License: apache-2.0
- Created: 2016-01-12T09:25:29.000Z (almost 9 years ago)
- Default Branch: master
- Last Pushed: 2018-08-22T14:06:56.000Z (over 6 years ago)
- Last Synced: 2024-11-12T17:02:32.437Z (about 1 month ago)
- Language: Go
- Size: 6.84 KB
- Stars: 19
- Watchers: 14
- Forks: 10
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# Consul RAFT database reader
This is a small tool to read Consul's commit log from the RAFT database and output the events in json format.
## Installing and building
```
go get -u github.com/outbrain/consul-raftdb-reader
```## Using
Copy the `raft/raft.db` file from a Consul server - the Consul server process must be turned off before copying because the file is continuosly mutated. After copying, open the file with this tool:
```
consul-raftdb-reader raft.db > raft.events
```## Indexing with ELK
A common use case is analyzing the dump with ELK. You can use the included ElasticSearch [index template](raft.es.template.json) to get ElasticSearch to index the fields properly.
```
curl -XPUT http://localhost:9200/_template/consul_raft -d @raft.es.template.es
```After the index template has been loaded, index the dump to ElasticSearch with Logstash:
```
consul-raftdb-reader raft.db | logstash agent -e 'input { stdin { codec => json_lines } } output { elasticsearch { index => "consul_raft" document_type => "raft_txn" hosts => ["localhost:9200"] } }'
```Now you can analyze the dump in Kibana.