2017-06-16 3 views
-1

Ich benutze ES 5.2. Ich habe einen Watcher implementiert. Aber jedes Mal, wenn der Watcher ausgelöst wird, erzeugt er E-Mails, aber Google blockiert diese E-Mails aufgrund von Sicherheitsbedenken. Was kann eine Lösung dafür sein?Google Mail blockiert meine elastische Suche Beobachter E-Mail

Meine YML Datei ist wie folgt:

cluster.name: Elasticsearch-logging

node.name: "Elasticsearch-Logging-0"

path.data:/var/lib/Elasticsearch/data

xpack.notification.email.account:

gmail_account:

Profil: gmail

SMTP-:

auth: true

starttls.enable: true

host: smtp.gmail.com

port: 587

user : ******.**@gmail.com

Passwort: ******

Während Locke auf Beobachter tun unten Antwort zu erhalten:

TUT Curl -

curl -XGET localhost:9200/_xpack/watcher/watch/last_watch 

unten Antwort bekommen:

{ 
    "found": true, 
    "id": "lastwatch", 
    "status": { 
    "version": 5, 
    "state": { 
     "active": true, 
     "timestamp": "2017-06-16T00:39:16.654Z" 
    }, 
    "lastchecked": "2017-06-16T00:43:00.229Z", 
    "last_met_condition": "2017-06-16T00:43:00.229Z", 
    "actions": { 
     "email_admin": { 
     "ack": { 
      "timestamp": "2017-06-16T00:39:16.654Z", 
      "state": "awaits_successful_execution" 
     }, 
     "last_execution": { 
      "timestamp": "2017-06-16T00:43:00.229Z", 
      "successful": false, 
      "reason": "MessagingException[failed to send email with subject [404 recently encountered] via account [gmail_account]]; nested: AuthenticationFailedException[534-5.7.14 https://accounts.google.com/signin/continue?sarp=1&scc=1&pltn534-5.7.14 q0WEdpll7GFx7wL5ZoIKlaHy0JIWKkJEAaiNf5hWY11ZPPsJb6u7h9z0Xe\n534-5.7.14 kWiT264a1EJgbKW5ESeccxI0uUZ_3X4klQS4jBjB7dDw6pRU490p-yKtXkL2-Ik\n534-5.7.14 vMoQFBgYsmH2WbbGFC3Z63GBpWVH0O9LmpVsB89ZsSreIXN_bb0AX3UWwoX4dTb4UiXtmi\nQI Please log in via your web browser and\n534-5.7.14 then try again.\n534-5.7.14 Learn more at\n534 5.7.14 https://support.google.com/mail/answer/78754 a22sm752699pfc.115 - gsmtp\n]; " 
     } 
     } 
    } 
    }, 
    "watch": { 
    "trigger": { 
     "schedule": { 
     "cron": "0 0/1 * * * ?" 
     } 
    }, 
    "input": { 
     "search": { 
     "request": { 
      "search_type": "query_then_fetch", 
      "indices": [ 
      "logstash*" 
      ], 
      "types": [], 
      "body": { 
      "query": { 
       "bool": { 
       "must": { 
        "match": { 
        "methodName": "getSSLConnectionSocketFactory" 
        } 
       } 
       } 
      } 
      } 
     } 
     } 
    }, 
    "condition": { 
     "compare": { 
     "ctx.payload.hits.total": { 
      "gt": 0 
     } 
     } 
    }, 
    "actions": { 
     "email_admin": { 
     "email": { 
      "profile": "standard", 
      "to": [ 
      "****.*****@gmail.com" 
      ], 
      "subject": "404 recently encountered" 
     } 
     } 
    } 
    } 
} 
+0

Verschönern Sie Ihren Code/Ihre Daten immer, bevor Sie Fragen stellen. –

Antwort

0

Sieht aus wie a javax.mail issue und Sie müssen less secure apps einschalten.

+0

Danke mein Problem behoben. Es gab zwei Wege - 1- entweder verwenden Sie weniger sichere App wie Sie sagten oder verwenden Sie den Schlüssel von Dritten wie pagerduty oder etwas. Der zweite Weg ist sehr sicher, da Sie Ihre Anmeldeinformationen nirgendwo fest codieren müssen. Dieser Drittanbieterschlüssel ist mit Ihrer Login-ID verknüpft. –