Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
M
metadata-collect-agent
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Analytics
Analytics
CI / CD
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Xiaowu Zhang
metadata-collect-agent
Commits
3a45181c
Commit
3a45181c
authored
Jun 04, 2021
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
disalbe secure check
parent
ad0b0ed0
Changes
1
Show whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
11 additions
and
3 deletions
+11
-3
src/go_plugin/out_gstdout.go
src/go_plugin/out_gstdout.go
+11
-3
No files found.
src/go_plugin/out_gstdout.go
View file @
3a45181c
...
@@ -8,6 +8,7 @@ import (
...
@@ -8,6 +8,7 @@ import (
"os"
"os"
"unsafe"
"unsafe"
"net/http"
"net/http"
"crypto/tls"
"github.com/fluent/fluent-bit-go/output"
"github.com/fluent/fluent-bit-go/output"
)
)
...
@@ -90,15 +91,22 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
...
@@ -90,15 +91,22 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
fmt
.
Printf
(
result
)
fmt
.
Printf
(
result
)
var
b
=
[]
byte
(
result
)
var
b
=
[]
byte
(
result
)
uri
:=
fmt
.
Sprintf
(
"%s/ingest?reference=#%s"
,
dict
[
"streamtool_uri"
],
C
.
GoString
(
tag
))
uri
:=
fmt
.
Sprintf
(
"%s/ingest?reference=#%s"
,
dict
[
"streamtool_uri"
],
C
.
GoString
(
tag
))
client
:=
&
http
.
Client
{}
client
:=
&
http
.
Client
{
Transport
:
&
http
.
Transport
{
TLSClientConfig
:
&
tls
.
Config
{
InsecureSkipVerify
:
true
},
},
}
req
,
err
:=
http
.
NewRequest
(
"POST"
,
uri
,
bytes
.
NewReader
(
b
))
req
,
err
:=
http
.
NewRequest
(
"POST"
,
uri
,
bytes
.
NewReader
(
b
))
if
err
!=
nil
{
if
err
!=
nil
{
fmt
.
Printf
(
"Got error %s"
,
err
.
Error
())
fmt
.
Fprintf
(
os
.
Stderr
,
"Got error %s"
,
err
.
Error
())
return
output
.
FLB_RETRY
return
output
.
FLB_RETRY
}
}
req
.
SetBasicAuth
(
dict
[
"user"
],
dict
[
"password"
])
req
.
SetBasicAuth
(
dict
[
"user"
],
dict
[
"password"
])
req
.
Header
.
Set
(
"Content-Type"
,
"application/octet-stream"
)
req
.
Header
.
Set
(
"Content-Type"
,
"application/octet-stream"
)
rsp
,
_
:=
client
.
Do
(
req
)
rsp
,
err
:=
client
.
Do
(
req
)
if
err
!=
nil
{
fmt
.
Fprintf
(
os
.
Stderr
,
"got error %s"
,
err
.
Error
())
}
if
rsp
.
StatusCode
!=
204
{
if
rsp
.
StatusCode
!=
204
{
fmt
.
Printf
(
"status code %d"
,
rsp
.
StatusCode
)
fmt
.
Printf
(
"status code %d"
,
rsp
.
StatusCode
)
return
output
.
FLB_RETRY
return
output
.
FLB_RETRY
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment