hanase  
                
               
                 
              
                  
                    January 23, 2019,  7:19am
                   
                   
              1 
               
             
            
              Hi elastic community,
I  use kibana watcher send alert message to telegram.
error log input search and filter work very well.
But, in actions part, I need to use proxy connect to the external network.
I got information below
Watcher: [parse_exception] could not parse http request template. unexpected string field [proxy.host]
 
My proxy setting wrong?
Here is my watcher config
"actions": { 
"my_webhook": { 
"webhook": { 
"scheme": "http", 
"host": "api.telegram.org ", 
"port": 443, 
"proxy.host": "172.16.99.125", 
"proxy.port": "3128", 
"method": "post", 
"path": "/botmybotid/sendMessage", 
"params": { 
"text": "There are {{ctx.payload.hits.total}} error logs occurred 30 minutes ago", 
"chat_id": "-mychatid" 
}, 
"headers": {} 
} 
} 
} 
}
 
             
            
               
               
               
            
            
           
          
            
              
                tsullivan  
                (Tim Sullivan)
               
              
                  
                    January 24, 2019,  9:21pm
                   
                   
              2 
               
             
            
              Hi, it looks like you meant to post this question in the Elasticsearch topic, because Watcher is a feature of X-Pack in Elasticsearch. Kibana has a UI for crafting Watches, but the functionality remains in ES.
Hope that helps, 
-Tim
             
            
               
               
               
            
            
           
          
            
              
                Izek  
                (IzekChen)
               
              
                  
                    January 25, 2019,  2:28am
                   
                   
              3 
               
             
            
              
 hanase:
 
"proxy.port": "3128",
 
 
try to remove the double quote
             
            
               
               
               
            
            
           
          
            
              
                hanase  
                
               
              
                  
                    January 25, 2019,  4:31am
                   
                   
              4 
               
             
            
              
hi, now remove the double quote
"actions": { 
"my_webhook": { 
"webhook": { 
"scheme": "https", 
"host": "api.telegram.org ", 
"port": 443, 
"proxy.host": "172.16.99.125", 
"proxy.port": 3128, 
"method": "post", 
"path": "/botmybotid/sendMessage", 
"params": { 
"text": "There are {{ctx.payload.hits.total}} error logs occurred 30 minutes ago", 
"chat_id": "mychatid" 
}, 
"headers": {} 
} 
} 
}
 
I still got information
Watcher: [parse_exception] could not parse http request template. unexpected string field [proxy.host]
 
             
            
               
               
               
            
            
           
          
            
              
                Izek  
                (IzekChen)
               
              
                  
                    January 25, 2019,  5:37am
                   
                   
              5 
               
             
            
              Remove double quote from proxy.host as well.
             
            
               
               
               
            
            
           
          
            
              
                hanase  
                
               
                 
              
                  
                    January 25, 2019,  6:39am
                   
                   
              6 
               
             
            
              hi, Izek
I remove double quote from proxy.host , then I got Invalid JSON error.
             
            
               
               
               
            
            
           
          
            
              
                hanase  
                
               
              
                  
                    January 28, 2019,  3:15am
                   
                   
              7 
               
             
            
              Here is my latest config, it is works!!
"actions": {
"my_webhook": {
  "webhook": {
    "scheme": "https",
    "host": "api.telegram.org",
    "port": 443,
    "method": "get",
    "path": "/bot**********:***********/sendMessage",
    "params": {
      "text": "There are {{ctx.payload.hits.total}} error logs occurred 30 minutes ago ",
      "chat_id": "-*********"
    },
    "headers": {},
    "proxy": {
      "host": "172.16.99.125",
      "port": 3128
    }
  }
}
 
}
             
            
               
               
               
            
            
           
          
            
              
                system  
                (system)
                  Closed 
               
              
                  
                    February 25, 2019,  3:16am
                   
                   
              8 
               
             
            
              This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.