SpecialistOff.NET / Вопросы / Статьи / Фрагменты кода / Резюме / Метки / Помощь / Файлы
Список вопросов ПечатьМетки: logstash
| RemiZOffAlex Создано: 2021-05-23 12:24:19.079397 Обновлено: 2021-05-23 12:24:19.079397 |
|---|
|
Самый простой добавить stdout {} в output С помощью Flask pipelines/pipeline.conf output {
http {
url => "http://127.0.0.1:5000/"
format => "json"
http_method => "post"
mapping => {
"logdatetime" => "%{logdatetime}"
"remote_addr" => "%{remote_addr}"
"server_name" => "%{server_name}"
"request_method" => "%{request_method}"
"uri" => "%{uri}"
"server_protocol" => "%{server_protocol}"
"status" => "%{status}"
"request_length" => "%{request_length}"
"bytes_sent" => "%{bytes_sent}"
"request_time" => "%{request_time}"
"http_referer" => "%{http_referer}"
"http_user_agent" => "%{http_user_agent}"
"http_x_forwarded_for" => "%{http_x_forwarded_for}"
}
}
}
Flask приложение import logging
from flask import Flask, request
app = Flask(__name__)
@app.route('/', methods=['POST'])
|