This simple example demonstrates how easy you can enable quite powerful and advanced log management in to your Spring Boot application
- Elastics Search is a distributed, JSON-based search and analytics engine designed for horizontal scalability, maximum reliability, and easy management.
- Logstash is a dynamic data collection pipeline with an extensible plugin ecosystem and strong Elasticsearch synergy.
- Kibana gives the visualization of data through a UI.
download logstash version : 6.2.2 create a new file logstash-config.conf and put :
input {
file {
path => "/PATH TO PROJECT/elk-example-spring-boot/elk-example.log.json"
start_position => "beginning"
sincedb_path => "/dev/null"
stat_interval => 1
codec => json {
charset => "UTF-8"
}
}
}
output {
elasticsearch {
hosts => "http://localhost:9200"
index => "elk_example"
document_type => "anywhere"
}
stdout { codec => rubydebug }
}
run bin/logstash -f logstash-simple.conf
download elasticsearch version : 6.2.2 and run it : ./elasticsearch
donwload kibana version : 6.2.2 and run it : ./kibana
now we can search our message :