Exportv4 cs mongodb into es

please check the error returned here.

Also, slight simplification:

    err = config.Execute(file, map[string]interface{}{
        "Dir": es.Dir,
        "HTTPPort": port,
    })