コード例 #1
0
    def __init__(self, options):
        self.event_parser = EventParser(options)

        output_type = options.get("output_type")
        self.output = None
        if output_type == "stdout":
            self.output = StdOutOutput()
        elif output_type == "file":
            self.output = FileOutput(options.get("outfile"))
        elif output_type == "tcp":
            (host, port) = options.get("tcpout").split(":")
            self.output = TcpOutput(host, int(port))
        elif output_type == "udp":
            (host, port) = options.get("udpout").split(":")
            self.output = UdpOutput(host, int(port))
        elif output_type == "s3":
            self.output = S3Output(options.get("s3out"),
                                   options.get("aws_key", None),
                                   options.get("aws_secret", None))
        else:
            raise ValueError("Invalid output type: %s" % output_type)