diff options
author | 2013-07-05 02:18:44 +0300 | |
---|---|---|
committer | 2013-07-05 02:18:44 +0300 | |
commit | adecdbc1cd849ca19fbccf2c189f676d54b51e85 (patch) | |
tree | 2f7ba57579c82fea03b99bebf74c286ab629fc28 /flask_app.py | |
parent | 'clean' target update (diff) | |
download | log-analysis-adecdbc1cd849ca19fbccf2c189f676d54b51e85.tar.gz log-analysis-adecdbc1cd849ca19fbccf2c189f676d54b51e85.tar.bz2 log-analysis-adecdbc1cd849ca19fbccf2c189f676d54b51e85.zip |
Group logs by source hostname and add multiple-file submissions
Diffstat (limited to 'flask_app.py')
-rw-r--r-- | flask_app.py | 11 |
1 files changed, 5 insertions, 6 deletions
diff --git a/flask_app.py b/flask_app.py index 87697e5..ce55c38 100644 --- a/flask_app.py +++ b/flask_app.py @@ -3,7 +3,7 @@ The web application built on Flask is contained within this file. When run as a script, the Flask development server is started. """ -import os +import os, socket import submission_pb2, storage from flask import Flask, request @@ -16,13 +16,12 @@ def index(): @app.route('/submit', methods=['POST']) def submit(): - """ - TODO: - pass through all steps - input, analysis, storage - """ submission = submission_pb2.Submission() submission.ParseFromString(request.data) - store.save_file(request.remote_addr, submission.filename, submission.data) + source = socket.getfqdn(request.remote_addr) # TODO: is this ok? + # TODO: pass through analyser + for f in submission.files: + store.save_file(source, f.filename, f.data) return '' if __name__ == '__main__': |