mvn -Dtest=FirstTest test
Check dependencies updates using TERMINAL
mvn versions:display-dependency-updates
Version: elasticsearch-8.17.0
D:\ELK_Stack\elasticsearch-8.17.0\bin\elasticsearch.bat
Take the password from the console after the first run, or reset it using the following command:
D:\ELK_Stack\elasticsearch-8.17.0\bin\elasticsearch-reset-password -u elastic
D:\ELK_Stack\logstash-8.17.0\bin\logstash -f D:\ELK_Stack\logstash-8.17.0\logstash.conf
Below is the logstash.conf
configuration for setting up Logstash to receive logs and send them to Elasticsearch.
input {
tcp {
port => 5044
codec => json_lines
}
}
output {
elasticsearch {
hosts => ["https://127.0.0.1:9200"]
user => "elastic"
password => "YvLGUzpp=ifXQ6PdtgNt"
ssl => true
ssl_certificate_verification => true
cacert => "D:/ELK_Stack/elasticsearch-8.17.0/config/certs/http_ca.crt"
}
}
...
# Socket Appender (for Logstash)
appender.socket.type = Socket
appender.socket.name = LOGSTASH
appender.socket.host = localhost
appender.socket.port = 5044
appender.socket.protocol = TCP
appender.socket.layout.type = JsonLayout
appender.socket.layout.compact = true
appender.socket.layout.eventEol = true
...
To start Kibana, run the following command:
D:/ELK_Stack/kibana-8.17.0/bin/kibana.bat
Access Kibana using the following URL: http://localhost:5601/?code=789340
When prompted, enter the enrollment token. Generate the token with the command below:
D:\ELK_Stack\elasticsearch-8.17.0\bin\elasticsearch-create-enrollment-token.bat --scope kibana
The Elasticsearch security features have been automatically configured:
- Authentication is enabled.
- Cluster connections are encrypted.
AtDsBxcAsDL3A*yfcXZb
48de21a555a3d97b1a2b38b9adfb29cf43521c5df1d941b0d234b19758321bdf
- Run Kibana and click the configuration link in the terminal when Kibana starts.
- Copy the following enrollment token and paste it into Kibana in your browser (valid for the next 30 minutes):
eyJ2ZXIiOiI4LjE0LjAiLCJhZHIiOlsiMTkyLjE2OC4wLjEwOjkyMDAiXSwiZmdyIjoiNDhkZTIxYTU1NWEzZDk3YjFhMmIzOGI5YWRmYjI5Y2Y0MzUyMWM1ZGYxZDk0MWIwZDIzNGIxOTc1ODMyMWJkZiIsImtleSI6IjJ3V3N4Wk1CdlhUaHpqYU92c0prOjBsV3lJOXVsUzAtenNDNFNnT1M4ZUEifQ==
-
On this node:
- Create an enrollment token with the following command:
bin/elasticsearch-create-enrollment-token -s node
- Uncomment the
transport.host
setting at the end ofconfig/elasticsearch.yml
. - Restart Elasticsearch.
- Create an enrollment token with the following command:
-
On other nodes:
- Start Elasticsearch using the following command with the enrollment token you generated:
bin/elasticsearch --enrollment-token <token>
- Start Elasticsearch using the following command with the enrollment token you generated:
- Open your browser and navigate to: http://localhost:5601
- Enter the enrollment token generated below.