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
7c3f032c
Commit
7c3f032c
authored
Jun 08, 2021
by
Xiaowu Zhang
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
check output
parent
cbad0852
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
10 additions
and
4 deletions
+10
-4
src/go_plugin/out_gstdout.go
src/go_plugin/out_gstdout.go
+10
-4
No files found.
src/go_plugin/out_gstdout.go
View file @
7c3f032c
...
@@ -50,6 +50,7 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
...
@@ -50,6 +50,7 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
// Iterate Records
// Iterate Records
var
result
string
var
result
string
result
=
""
result
=
""
var
is_end
bool
=
false
for
{
for
{
// Extract Record
// Extract Record
ret
,
ts
,
record
=
output
.
GetRecord
(
dec
)
ret
,
ts
,
record
=
output
.
GetRecord
(
dec
)
...
@@ -72,10 +73,14 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
...
@@ -72,10 +73,14 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
result
=
result
+
C
.
GoString
(
tag
)
+
":"
+
timestamp
.
String
()
result
=
result
+
C
.
GoString
(
tag
)
+
":"
+
timestamp
.
String
()
for
_
,
v
:=
range
record
{
for
_
,
v
:=
range
record
{
result
+=
"["
result
+=
"["
var
output_string
string
=
""
for
_
,
s
:=
range
v
.
([]
uint8
)
{
for
_
,
s
:=
range
v
.
([]
uint8
)
{
result
=
result
+
string
(
s
)
output_string
=
output_string
+
string
(
s
)
}
}
result
+=
"]"
if
output_string
==
"fluentbit_end"
{
is_end
=
true
}
result
=
result
+
output_string
+
"]"
}
}
result
+=
"
\n
"
result
+=
"
\n
"
}
}
...
@@ -88,7 +93,6 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
...
@@ -88,7 +93,6 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
//body result
//body result
// content type "application/octet-stream"
// content type "application/octet-stream"
//
//
fmt
.
Println
(
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
{
...
@@ -111,7 +115,9 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
...
@@ -111,7 +115,9 @@ func FLBPluginFlushCtx(ctx, data unsafe.Pointer, length C.int, tag *C.char) int
fmt
.
Printf
(
"status code %d"
,
rsp
.
StatusCode
)
fmt
.
Printf
(
"status code %d"
,
rsp
.
StatusCode
)
return
output
.
FLB_RETRY
return
output
.
FLB_RETRY
}
}
os
.
Exit
(
0
)
if
is_end
{
os
.
Exit
(
0
)
}
return
output
.
FLB_OK
return
output
.
FLB_OK
}
}
...
...
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