from flask import Flask, request from flask_restful import Resource, Api from logger import logger app = Flask(__name__) api = Api(app) class HelloWorld(Resource): def post(self, user, action, computer): logger.info(f"{computer},{action},{user},{request.remote_addr}") return { "user": user, "action": action, "ip_remote": request.remote_addr, "computer": computer } api.add_resource( HelloWorld, '/my_command///' ) if __name__ == '__main__': app.run(debug=True, host="0.0.0.0")