tensor/service.py
def setupOutputs(self, config):
        """Setup output processors"""

        if self.proto == 'tcp':
            defaultOutput = {
                'output': 'tensor.outputs.riemann.RiemannTCP',
                'server': self.server,
                'port': self.port
            }
        else:
            defaultOutput = {
                'output': 'tensor.outputs.riemann.RiemannUDP',
                'server': self.server,
                'port': self.port
            }

        outputs = config.get('outputs', [defaultOutput])

        for output in outputs:
            if not ('debug' in output):
                output['debug'] = self.debug

            cl = output['output'].split('.')[-1]                # class
            path = '.'.join(output['output'].split('.')[:-1])   # import path

            # Import the module and construct the output object
            outputObj = getattr(
                importlib.import_module(path), cl)(output, self)

            name = output.get('name', None)

            # Add the output to our routing hash
            if name in self.outputs:
                self.outputs[name].append(outputObj)
            else:
                self.outputs[name] = [outputObj]

            # connect the output
            reactor.callLater(0, outputObj.createClient)
def setupOutputs(self, config):
        if self.proto == 'tcp':
            defaultOutput = {
                'output': 'tensor.outputs.riemann.RiemannTCP',
                'server': self.server,
                'port': self.port
            }
        else:
            defaultOutput = {
                'output': 'tensor.outputs.riemann.RiemannUDP',
                'server': self.server,
                'port': self.port
            }

        outputs = config.get('outputs', [defaultOutput])

        for output in outputs:
            if not ('debug' in output):
                output['debug'] = self.debug

            cl = output['output'].split('.')[-1]                # class
            path = '.'.join(output['output'].split('.')[:-1])   # import path

            # Import the module and construct the output object
            outputObj = getattr(
                importlib.import_module(path), cl)(output, self)

            name = output.get('name', None)

            # Add the output to our routing hash
            if name in self.outputs:
                self.outputs[name].append(outputObj)
            else:
                self.outputs[name] = [outputObj]

            # connect the output
            reactor.callLater(0, outputObj.createClient)
def setupOutputs ( self , config ) : if self . proto == 'tcp' : defaultOutput = { 'output' : 'tensor.outputs.riemann.RiemannTCP' , 'server' : self . server , 'port' : self . port } else : defaultOutput = { 'output' : 'tensor.outputs.riemann.RiemannUDP' , 'server' : self . server , 'port' : self . port } outputs = config . get ( 'outputs' , [ defaultOutput ] ) for output in outputs : if not ( 'debug' in output ) : output [ 'debug' ] = self . debug cl = output [ 'output' ] . split ( '.' ) [ - 1 ] # class path = '.' . join ( output [ 'output' ] . split ( '.' ) [ : - 1 ] ) # import path # Import the module and construct the output object outputObj = getattr ( importlib . import_module ( path ) , cl ) ( output , self ) name = output . get ( 'name' , None ) # Add the output to our routing hash if name in self . outputs : self . outputs [ name ] . append ( outputObj ) else : self . outputs [ name ] = [ outputObj ] # connect the output reactor . callLater ( 0 , outputObj . createClient )
Setup output processors
Setup output processors