logstash输出:
output{
if [type]=="nxlog-json"{
http {
codec => json
http_method => "post"
url=>"http://192.168.1.112:9763/endpoints/test"
}
}
}
HTTP Receiver配置:
<?xml version="1.0" encoding="UTF-8"?>
<eventReceiver name="test" statistics="disable" trace="disable" xmlns="http://wso2.org/carbon/eventreceiver">
<from eventAdapterType="http">
<property name="basicAuthEnabled">false</property>
<property name="transports">all</property>
</from>
<mapping customMapping="disable" type="json"/>
<to streamName="teststream" version="1.0.0"/>
</eventReceiver>
日志中的错误:
错误{org.wso2.carbon.event.input.adapter.http.HTTPMessageServlet} - 解析http请求进行处理时出错:Path&#39; event&#39;不 在当前背景下找到:
如何解决?
WSO2 CEP版本4.2.0
答案 0 :(得分:0)
通过“event”:{}包装json对象解决了这个问题,如下所示。
jsonObject={
"event": {
"payloadData": {
"companyID":companyID,
"activityID":activityID
}
}
}