Exemple #1
0
class SyslogUDP(protocol.DatagramProtocol):

    esclient = None

    def datagramReceived(self, data, (host, port)):
        log.msg(data)
        for log_item in SyslogProtocol.decode(data):
            log_item["host"] = host
            self.esclient.send(log_item)
Exemple #2
0
 def dataReceived(self, data):
     for log_item in SyslogProtocol.decode(data):
         log_item["host"] = self.transport.getPeer().host
         self.esclient.send(log_item)