Last active
June 12, 2020 16:47
-
-
Save edefaria/0de27df3f4148a64b9857f58ceb82381 to your computer and use it in GitHub Desktop.
This file contains 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
#!/bin/bash | |
SERVER="gra1.logs.ovh.com" | |
USER="logs-xx-00000" | |
PASS="xxxxxxxx" | |
PREFIX="logs-xx-00000" | |
SUFFIX="elastalert" | |
cd /tmp | |
wget https://raw.githubusercontent.com/Yelp/elastalert/master/elastalert/es_mappings/6/elastalert.json https://raw.githubusercontent.com/Yelp/elastalert/master/elastalert/es_mappings/6/elastalert_error.json https://raw.githubusercontent.com/Yelp/elastalert/master/elastalert/es_mappings/6/elastalert_status.json https://raw.githubusercontent.com/Yelp/elastalert/master/elastalert/es_mappings/6/past_elastalert.json https://raw.githubusercontent.com/Yelp/elastalert/master/elastalert/es_mappings/6/silence.json | |
curl -XPUT -H 'Content-Type: application/json' -u "$USER:$PASS" "https://${SERVER}:9200/${PREFIX}-i-${SUFFIX}/_mapping/_doc" --data @elastalert.json | |
curl -XPUT -H 'Content-Type: application/json' -u "$USER:$PASS" "https://${SERVER}:9200/${PREFIX}-i-${SUFFIX}_error/_mapping/_doc" --data @elastalert_error.json | |
curl -XPUT -H 'Content-Type: application/json' -u "$USER:$PASS" "https://${SERVER}:9200/${PREFIX}-i-${SUFFIX}_status/_mapping/_doc" --data @elastalert_status.json | |
curl -XPUT -H 'Content-Type: application/json' -u "$USER:$PASS" "https://${SERVER}:9200/${PREFIX}-i-${SUFFIX}_past/_mapping/_doc" --data @past_elastalert.json | |
curl -XPUT -H 'Content-Type: application/json' -u "$USER:$PASS" "https://${SERVER}:9200/${PREFIX}-i-${SUFFIX}_silence/_mapping/_doc" --data @silence.json | |
rm -f elastalert.json elastalert_error.json elastalert_status.json past_elastalert.json silence.json |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment