Elk for logs.

feature/elk
frozen 1 year ago
parent c82599b6f1
commit 2873a786fb
No known key found for this signature in database
GPG Key ID: 5391C63E79B03EDE
  1. 3
      Makefile
  2. 36
      scripts/elk/docker-compose.yml
  3. 25
      scripts/elk/logstash.conf

@ -180,3 +180,6 @@ debug_external: clean
build_localnet_validator:
bash test/build-localnet-validator.sh
elk:
docker-compose -f scripts/elk/docker-compose.yml up

@ -0,0 +1,36 @@
version: '3'
services:
es01-test:
image: docker.elastic.co/elasticsearch/elasticsearch:7.17.14
container_name: es01-test
networks:
- elastic
ports:
- "127.0.0.1:9200:9200"
- "127.0.0.1:9300:9300"
environment:
- discovery.type=single-node
kib01-test:
image: docker.elastic.co/kibana/kibana:7.17.14
container_name: kib01-test
networks:
- elastic
ports:
- "0.0.0.0:5601:5601"
environment:
- ELASTICSEARCH_HOSTS=http://es01-test:9200
logstash:
image: docker.elastic.co/logstash/logstash:8.11.1
container_name: logstash-container
networks:
- elastic
volumes:
- ./scripts/elk/logstash.conf:/usr/share/logstash/config/logstash.conf
- ./tmp_log:/tmp_log
command: logstash -f /usr/share/logstash/config/logstash.conf
networks:
elastic:
driver: bridge

@ -0,0 +1,25 @@
input {
file {
path => "/tmp_log/*/*.log"
start_position => "beginning"
sincedb_path => "/dev/null"
codec => "json"
}
}
filter {
# You can add additional filters here if needed
}
output {
stdout {
codec => rubydebug
}
# You can send the parsed logs to other outputs like Elasticsearch
# Uncomment the lines below and modify the Elasticsearch configuration
elasticsearch {
hosts => ["es01-test:9200"]
index => "harmony"
}
}
Loading…
Cancel
Save