def start(host, port=5959, tag='salt/engine/logstash'):
    logstash_logger = logging.getLogger('python-logstash-logger')
    logstash_logger.setLevel(logging.INFO)
    logstash_logger.addHandler(logstash.LogstashHandler(host, port, version=1))

    if __opts__.get('id').endswith('_master'):
        event_bus = salt.utils.event.get_master_event(
                __opts__,
                __opts__['sock_dir'],
                listen=True)
    else:
        event_bus = salt.utils.event.get_event(
            'minion',
            transport=__opts__['transport'],
            opts=__opts__,
            sock_dir=__opts__['sock_dir'],
            listen=True)
        log.debug('Logstash engine started')

    while True:
        event = event_bus.get_event()
        if event:
            logstash_logger.info(tag, extra=json.dumps(event))
If a dataset with the given name already exists,
dataset/ETHPy150Open saltstack/salt/salt/engines/logstash.py/start--crossover with--dataset/ETHPy150Open ClusterHQ/flocker/flocker/dockerplugin/test/test_api.py/APITestsMixin.test_create_duplicate_name