HTTP接入
被集成系统提供RestFul接口由平台定时采集需要集成的数据,以逐条记录方式传递给处理规则,并通过规则处理后,保存入平台。
# httpd
[TestHttpdInput]
type = "ProcessInput"
splitter = "split_n"
stdout = true
stderr = true
is_daemon = true
[TestHttpdInput.command.0]
bin = "./httpd"
directory = "/opt/matrix/var/test/httpd"
args = ["-etcd", "/matrix/apps/collector/httpd/config.json","-name", "httpd_wecise_test", "-debug"]
[TestHttpdOutput]
type = "LogOutput"
use_global_logger = false
console = false
server_log_name = "httpd_wecise"
server_log_type = "daemon"
server_log_keyspace = "matrix"
message_matcher = "Logger == 'TestHttpdInput'"
encoder = "PayloadEncoder"
[!NOTE]
配置文件支持存放在ETCD上,也支持存放在操作系统的文件系统里
示例
/matrix/apps/collector/httpd/config.json
{
"rule": "/matrix/rules/test/omni",
"perfrule": "/matrix/rules/test/omniperf",
"domain": "test",
"rules": [
{
"enable": true,
"requestname": "test",
"url": "http://47.92.151.165:8080/test",
"method": "GET",
"body": "",
"timeout": 10,
"poll": 10,
"failureretests": 0,
"retestinterval": 0,
"description": "Test http task"
}
]
}