- Download Elastic Search and unzip it
- Start Elastic search with the following command and go to URL http://localhost:9200
$ bin/elasticsearch
- Download LogStash and unzip it
- Create
logstash-elk.conf
file on logstash home directory with the following content and change the log file location and index name based on your settings
input {
file {
path => "/Users/johnd/ELK-Stack/logback/*.log"
codec => "json"
type => "logback"
}
}
output {
if [type]=="logback" {
elasticsearch {
hosts => [ "localhost:9200" ]
index => "logstash"
}
}
}
- Start the logstash with the command
$ bin/logstash -f logstash-elk.conf
- Download Kibana then unzip it, run it with the following command
bin/kibana
- Go to http://localhost:5601 to see Kibana UI
- Go to Spring Boot
application.yml
file and add logging file location oproperties
# Logging
logging:
file: /Users/johnd/ELK-Stack/logback/springsecuritydata.log
- Restart the Spring Boot application to capture logs in the newly created file
springsecuritydata.log
- Go to Kibana UI -> Management -> Create Index pattern -> Type index name (You should see the index name below)
- Go to Kibana UI -> Dashboard to see Spring Boot log data, modify the filter to see data from past