Created
March 15, 2020 02:16
-
-
Save subfission/1478a3ded8296f8d62a92e2b570ed719 to your computer and use it in GitHub Desktop.
Filebeat dashboard loader through docker.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Version refernces: https://www.docker.elastic.co/# | |
FILEBEATVER="6.8.7" | |
ELASTICHOST="127.0.0.1:9200" | |
KIBANAHOST="127.0.0.1:5601" | |
usage() { | |
echo "Usage: ./beatboard_loader.sh 'ELASTIC_HOST:PORT' 'KIBANA:PORT' [FILEBEATVER]" | |
echo """ | |
ELASTIC_HOST:PORT The ElasticSearch host and port number (required) | |
KIBANA:PORT The Kibana host and port number (required) | |
FILEBEATVER The version number to set for filebeat | |
Note: This script does not account for authentication. | |
""" | |
} | |
command -v "docker" || { echo "Missing docker"; usage; exit 1; } | |
echo "Init docker" | |
echo "Starting containers and pushing index..." | |
docker run docker.elastic.co/beats/filebeat:${FILEBEATVER:$3} setup \ | |
--template -E output.logstash.enabled=false \ | |
-E 'output.elasticsearch.hosts=["'${ELASTICHOST:$1}'"]' \ | |
-E setup.kibana.host=${KIBANAHOST:$2} | |
echo "done." | |
echo "Starting containers and pushing dashboards..." | |
docker run docker.elastic.co/beats/filebeat:${FILEBEATVER:$3} setup \ | |
--dashboards -E output.logstash.enabled=false \ | |
-E 'output.elasticsearch.hosts=["'${ELASTICHOST:$1}'"]' \ | |
-E setup.kibana.host=${KIBANAHOST:$2} | |
echo "done." |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment