Commit f4b69262 authored by Xiaowu Zhang's avatar Xiaowu Zhang

use portal ingestion

parent edfcd6d0
......@@ -7,9 +7,9 @@
[output]
name wendelin_fluentbit
match *
streamtool_uri https://softinst140097.host.vifib.net/erp5
user xx
password xx
streamtool_uri https://softinst143932.host.vifib.net/erp5/portal_ingestion_policies/default
user zope
password pskmtwfn
buffer_type memory
flush_interval 60s
disable_retry_limit true
......@@ -87,6 +87,7 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
//body result
// content type "application/octet-stream"
//
fmt.Printf(result)
var b = []byte(result)
uri := fmt.Sprintf("%s/ingest?reference=#%s", dict["streamtool_uri"], C.GoString(tag))
client := &http.Client{}
......@@ -98,7 +99,7 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
req.SetBasicAuth(dict["user"], dict["password"])
req.Header.Set("Content-Type", "application/octet-stream")
rsp, _ := client.Do(req)
if rsp.StatusCode != http.StatusOK {
if rsp.StatusCode != 204 {
fmt.Printf("status code %d", rsp.StatusCode)
return output.FLB_RETRY
}
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment