How to use python to realize FTP transfer

the backend has many logs or files distributed on hundreds of servers. You want to use flask to build a service and request to input information such as ip, path and file name of the backend service, and use the service provided by flask to obtain the backend files, instead of directly connecting to the backend server through ftp.
the way you can imagine is to first get the back-end file to the flask server through ftplib, and then transfer the back-end file to the client using flask"s send_from_directory, but this will cause the file to land on the flask once more. Do you have a more efficient solution?
Thank you

Mar.05,2021

you can learn about the recent popularity of ELK combinations ElasticSearch, LogStash, and Kibana,

https://www.digitalocean.com/.

https://www.elastic.co/cn/pro.


-sharp 
-sharp flask
@bp.route('/download', methods=['GET'])
def handle_download_branch():
  -sharp 
  params = flask.request.args
  -sharp  wget '' 
  resp = httputil.get('')
  return (resp.content, resp.status_code, resp.headers.items())
Menu