Nem tudo é sobre shell
Impacto é impacto.
from flask import Flask, jsonify, request
from utils.logs import get_log_content
import re
= Flask("testapp")
app
# Find content on logs and returns the matched lines.
@app.route("/logs/find", methods=["POST"])
def logs_find():
= request.json
request_data = request_data["pattern"]
pattern
= re.findall(
match f"^.*{pattern}.*$",
get_log_content(),
re.MULTILINE,
)
return jsonify(
{"match": match,
} )