-
Notifications
You must be signed in to change notification settings - Fork 255
Http Sender
Sun Jianbo edited this page Jul 16, 2018
·
5 revisions
Http Sender 是 logkit
提供的以 http post 请求的方式发送数据的形式
"sender":{
"sender_type":"http",
"http_sender_url": "127.0.0.1:4001/logkit/data",
"http_sender_gzip": "true",
"http_sender_protocol": "json",
"http_sender_csv_head": "true",
"http_sender_csv_split": "\t"
}
-
http_sender_url
: 必填, post 请求发送的路径 -
http_sender_gzip
: 选填, 发送时启用gzip
, 默认开启 -
http_sender_protocol
: 选填, 发送的数据格式, 有json
、csv
、body_json
三种选择, 默认为json
-
http_sender_csv_head
: 选填, 若值为true
, 则使用csv
发送时第一行为每一列的列名称, 默认为true
-
http_sender_csv_split
: 选填, 使用csv
发送时, 不同列之前的分隔符, 默认为\t
http_sender_csv_head
为 true 时,
name timestamp value age
jack 1529980502 hehe 21
mark 1529980413 nini 19
yell 1529980123 xsxs 30
http_sender_csv_head
为 false 时,
jack 1529980502 hehe 21
mark 1529980413 nini 19
yell 1529980123 xsxs 30
{"name":"jack","timestamp":1529980502,"value":"hehe","age":21}
{"name":"mark","timestamp":1529980413,"value":"nini","age":19}
{"name":"yell","timestamp":1529980123,"value":"xsxs","age":30}
选择 json
格式后,http sender的 body 每行都是一个json,多行用换行符\n
分隔,读取时请按行读取,对于单行按json格式解析。
[{"name":"jack","timestamp":1529980502,"value":"hehe","age":21},
{"name":"mark","timestamp":1529980413,"value":"nini","age":19},
{"name":"yell","timestamp":1529980123,"value":"xsxs","age":30}]
选择 body_json
格式表示整个发送的body都是json格式
快速开始 | Pandora | Readers | Parsers | Senders | Download | 七牛智能日志管理平台 | logkit-pro专业版