Ejemplo n.º 1
0
def init_es_data():
    hosts_config = get_cluster_config("events").get("hosts")
    if not hosts_config:
        raise MissingElasticConfiguration("for cluster 'events'")

    for conf in hosts_config:
        host = furl(scheme="http", host=conf["host"], port=conf["port"]).url
        log.info(f"Applying mappings to host: {host}")
        res = apply_mappings_to_host(host)
        log.info(res)
Ejemplo n.º 2
0
def init_es_data():
    hosts_key = "hosts.elastic.events.hosts"
    hosts_config = config.get(hosts_key, None)
    if not hosts_config:
        raise MissingElasticConfiguration(hosts_key)

    for conf in hosts_config:
        host = furl(scheme="http", host=conf["host"], port=conf["port"]).url
        log.info(f"Applying mappings to host: {host}")
        res = apply_mappings_to_host(host)
        log.info(res)