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)
def dataReceived(self, data): for log_item in SyslogProtocol.decode(data): log_item["host"] = self.transport.getPeer().host self.esclient.send(log_item)