Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
slapos
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
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Eteri
slapos
Commits
ad5f9532
Commit
ad5f9532
authored
Jan 03, 2018
by
Eteri
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
fleutnbit: wendeling plugin initial commit
parent
d9ae0eb1
Changes
4
Hide whitespace changes
Inline
Side-by-side
Showing
4 changed files
with
144 additions
and
6 deletions
+144
-6
software/fluentbit/instance.cfg.in
software/fluentbit/instance.cfg.in
+5
-4
software/fluentbit/software.cfg
software/fluentbit/software.cfg
+52
-2
software/fluentbit/wendelin-plugin/conf.cnf
software/fluentbit/wendelin-plugin/conf.cnf
+9
-0
software/fluentbit/wendelin-plugin/out_wendelin.go
software/fluentbit/wendelin-plugin/out_wendelin.go
+78
-0
No files found.
software/fluentbit/instance.cfg.in
View file @
ad5f9532
...
...
@@ -19,8 +19,9 @@ bin = ${:home}/bin
[fluentbit-service]
recipe = slapos.cookbook:wrapper
#command-line = {{ fluentbit_source_location }}/build/bin/fluent-bit -i cpu -o stdout
command-line = {{ fluentbit_source_location }}/build/bin/fluent-bit -e {{ fluentbit_go_repository_location}}/examples/out_gstdout/out_gstdout.so -i cpu -o gstdout
command-line =
{{ fluentbit_source_location }}/build/bin/fluent-bit -c {{ wendelin_conf_file }}/conf.cnf -e
{{ wendelin_test_path}}/{{ wendelin_plugin_filename }}.so
-i cpu -o wendelin_out -v
wrapper-path = ${directory:service}/fluentbit-service
output = $${:wrapper-path}
output = $${:wrapper-path}
\ No newline at end of file
software/fluentbit/software.cfg
View file @
ad5f9532
...
...
@@ -12,7 +12,10 @@ parts =
instance-profile
fluentbit-go-repository
fluentbit-build-go
# wendelin-profile
wendelin-plugin-file
wendelin-test
wendelin-conf-file
[instance-profile]
recipe = slapos.recipe.template:jinja2
...
...
@@ -24,6 +27,9 @@ context =
section buildout buildout
key fluentbit_source_location fluentbit-source:location
key fluentbit_go_repository_location fluentbit-go-repository:location
key wendelin_test_path wendelin-test:path
key wendelin_plugin_filename wendelin-plugin-file:filename
key wendelin_conf_file wendelin-conf-file:location
[fluentbit-source]
recipe = slapos.recipe.build:gitclone
...
...
@@ -50,4 +56,48 @@ path = ${fluentbit-go-repository:location}
configure-command = cd ${:path} && ${:go} get github.com/fluent/fluent-bit-go/output
make-binary =
make-targets = cd ${:path}/examples/out_gstdout &&
${:go} build -buildmode=c-shared -o out_gstdout.so out_gstdout.go
\ No newline at end of file
${:go} build -buildmode=c-shared -o out_gstdout.so out_gstdout.go
[wendelin-plugin-file]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/wendelin-plugin/out_wendelin.go
#md5sum = 88c4c33e374ea3f61cdd36b2816d24ba
filename = out_wendelin.go
location = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644
[wendelin-conf-file]
recipe = slapos.recipe.build:download
url = ${:_profile_base_location_}/wendelin-plugin/conf.cnf
#md5sum = 88c4c33e374ea3f61cdd36b2816d24ba
filename = conf.cnf
location = ${buildout:parts-directory}/${:_buildout_section_name_}
mode = 0644
[wendelin-test]
recipe = slapos.recipe.cmmi
go = ${golang19:location}/bin/go
path = ${wendelin-plugin-file:location}
configure-command = cd ${:path} && ${:go} get github.com/fluent/fluent-bit-go/output
make-binary =
make-targets = cd ${:path} &&
${:go} build -buildmode=c-shared -o ${wendelin-plugin-file:filename}.so ${wendelin-plugin-file:filename}
#[wendelin-profile]
#recipe = slapos.recipe.template:jinja2
#template = ${:_profile_base_location_}/wendelin-plugin/out_wendelin.go
#rendered = ${fluentbit-go-repository:location}/examples/out_gstdout/out_wendelin.go
#md5sum = a4cc579e1a4dd0eb58792a8dc6d47bc9
#mode = 0644
#[wendelin-test]
#recipe = slapos.recipe.cmmi
#go = ${golang19:location}/bin/go
#path = ${fluentbit-go-repository:location}
#configure-command = cd ${:path} && ${:go} get github.com/fluent/fluent-bit-go/output
#make-binary =
#make-targets = cd ${:path}/examples/out_gstdout &&
# ${:go} build -buildmode=c-shared -o out_wendelin.so out_wendelin.go
software/fluentbit/wendelin-plugin/conf.cnf
0 → 100644
View file @
ad5f9532
[INPUT]
Name cpu
Tag cpu
[OUTPUT]
Name http
Match *
Host softinst84835.host.vifib.net
URI /erp5
\ No newline at end of file
software/fluentbit/wendelin-plugin/out_wendelin.go
0 → 100644
View file @
ad5f9532
package
main
import
"github.com/fluent/fluent-bit-go/output"
import
(
"fmt"
"unsafe"
"C"
)
//export FLBPluginRegister
func
FLBPluginRegister
(
ctx
unsafe
.
Pointer
)
int
{
return
output
.
FLBPluginRegister
(
ctx
,
"wendelin_out"
,
"Wendelin Out GO!"
)
}
//export FLBPluginInit
// (fluentbit will call this)
// ctx (context) pointer to fluentbit context (state/ c code)
func
FLBPluginInit
(
ctx
unsafe
.
Pointer
)
int
{
// Example to retrieve an optional configuration parameter
param
:=
output
.
FLBPluginConfigKey
(
ctx
,
"param"
)
user
:=
output
.
FLBPluginConfigKey
(
ctx
,
"user"
)
password
:=
output
.
FLBPluginConfigKey
(
ctx
,
"password"
)
uri
:=
output
.
FLBPluginConfigKey
(
ctx
,
"uri"
)
fmt
.
Printf
(
"[flb-go] plugin parameter = '%s'
\n
"
,
param
)
fmt
.
Printf
(
"[flb-go] plugin parameter = '%s'
\n
"
,
user
)
fmt
.
Printf
(
"[flb-go] plugin parameter = '%s'
\n
"
,
password
)
fmt
.
Printf
(
"[flb-go] plugin parameter = '%s'
\n
"
,
uri
)
return
output
.
FLB_OK
}
//export FLBPluginFlush
func
FLBPluginFlush
(
data
unsafe
.
Pointer
,
length
C
.
int
,
tag
*
C
.
char
)
int
{
// change here for wendelin
// var count int
// var ret int
// var ts interface{}
// var record map[interface{}]interface{}
/*
// Create Fluent Bit decoder
dec := output.NewDecoder(data, int(length))
// Iterate Records
count = 0
for {
// Extract Record
ret, ts, record = output.GetRecord(dec)
if ret != 0 {
break
}
// Print record keys and values
timestamp := ts.(output.FLBTime)
fmt.Printf("[%d] %s: [%s, {", count, C.GoString(tag),
timestamp.String())
for k, v := range record {
fmt.Printf("\"%s\": %v, ", k, v)
}
fmt.Printf("}\n")
count++
}
*/
// Return options:
//
// output.FLB_OK = data have been processed.
// output.FLB_ERROR = unrecoverable error, do not try this again.
// output.FLB_RETRY = retry to flush later.
return
output
.
FLB_OK
}
//export FLBPluginExit
func
FLBPluginExit
()
int
{
return
output
.
FLB_OK
}
func
main
()
{
}
\ No newline at end of file
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