- Notifications
You must be signed in to change notification settings - Fork260
Http Reader
Sun Jianbo edited this pageJan 16, 2018 ·4 revisions
Http Reader 是logkit
提供的以 http post 请求的方式接受并读取日志的形式
"reader":{ "mode": "http", "http_service_address": "127.0.0.1:4001", "http_service_path": "/logkit/data"}
http_service_address
: 必填, 监听的地址和端口(地址可以留空, 即上述示例可以只填写:4001
)http_service_path
: 选填, 请求发送的路径(上述示例中, post 请求应该发往http://127.0.0.1:4001/logkit/data
)tag_file
可选项,可以读取一个json格式的文件,并把json的数据作为标签附着在所有数据之上。典型的应用场景为一些机器或者容器相关的元数据存以json格式放在文件中,logkit发送的数据都带上这些元数据,以便查询时可以快速定位机器元数据,并根据元数据做报警等后续事宜。
- 该 reader 支持
gzip
, 但请在请求头中添加Content-Encoding=gzip
或者Content-Type=application/gzip
- 默认接收 request body 中所有的数据作为要读取的日志, 限制 request body 小于 100MB
- 默认将 request body 中的数据使用
\n
分割, 每行作为一条数据