Skip to content

Instantly share code, notes, and snippets.

@Simonx123
Forked from Callonski/logstash.sh
Created September 7, 2020 01:06
Show Gist options
  • Save Simonx123/a5037b9bf416c65c993c433c64d2d0c8 to your computer and use it in GitHub Desktop.
Save Simonx123/a5037b9bf416c65c993c433c64d2d0c8 to your computer and use it in GitHub Desktop.
################ LOGSTASH ##############################
sudo systemctl enable logstash
sudo systemctl start logstash
sudo /usr/share/logstash/bin/logstash-plugin install x-pack
sudo bin/logstash-keystore create
echo "${elastic_pw}" | sudo bin/logstash-keystore add ES_PASSWORD
cat <<EOT >> /etc/logstash/logstash.yml
xpack.monitoring.enabled: true
xpack.monitoring.elasticsearch.url: 'https://${internal_lb_ip}:9200'
xpack.monitoring.elasticsearch.username: 'elastic'
# read password from logstash.keystore
xpack.monitoring.elasticsearch.password: '${ES_PASSWORD}'
xpack.monitoring.elasticsearch.ssl.certificate_authority: /etc/kibana/elasticsearch-ca.pem
xpack.monitoring.elasticsearch.ssl.verification_mode: 'none'
output {
elasticsearch {
hosts: ['https://${elastic_host_1}:9200','https://${elastic_host_2}:9200','https://${elastic_host_3}:9200']
user: 'elastic'
password: '${ES_PASSWORD}'
}
}
EOT
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment