Skip to content

Instantly share code, notes, and snippets.

@michiel
Last active February 6, 2018 02:45
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save michiel/ddc307435906cd9da08fabb2f81eeb17 to your computer and use it in GitHub Desktop.
Save michiel/ddc307435906cd9da08fabb2f81eeb17 to your computer and use it in GitHub Desktop.
fluent-bit dev

Manage and update remote branches

git remote add upstream https://github.com/fluent/fluent-bit.git
git checkout -b ffscl-master
git remote add ffscl https://github.com/ffscl/fluent-bit.git
git fetch -v ffscl master
git branch --set-upstream-to=ffscl/master
git remote -v

Dev

git clone https://github.com/michiel/fluent-bit
cd fluent-bit
cd build
cmake -DFLB_DEBUG=On ..
make
./bin/fluent-bit -v -c ~/fluent-bit-rename.conf

indent -i4 -npsl -di0 -br -nce -d0 -cli0 -npcs -nfc1 -nut plugins/filter_record_modifier/filter_record_modifier.c

With valgrind

valgrind ./bin/fluent-bit -v -c ~/fluent-bit-rename.conf

With valgrind and GDB, run in separate terminals,

valgrind --vgdb=yes --vgdb-error=0 ./bin/fluent-bit -v -c ~/fluent-bit-rename.conf
gdb ./bin/fluent-bit

Valgrind ouput will contain the command to run in gdb, something like target remote | /usr/lib/valgrind/../../bin/vgdb --pid=20699. Take that command and run it on the gdb prompt. After that, run gdb command c or continue to run the program

Integration

git checkout -b integration/main
git fetch upstream
git fetch ffscl
git merge ffscl/feature/out_json_date_key
git merge ffscl/feature/record_modifier_remove_prefix
git merge ffscl/feature/out_http_json_stream
# Resolve merge conflict
git add plugins/out_http/http.c
git commit -m "Resolve merge conflict"
git push origin integration/main

# git merge ffscl/feature/flat_kubernetes_metadata
# git merge feature/rename-key
# git merge feature/conditional-record-append

Travis status https://travis-ci.org/michiel/fluent-bit

Testing

Make sure the googletest library is installed

cd build
make clean
git clean -fdx
cmake -DFLB_TESTS_RUNTIME=ON -DENABLE_TESTING=ON ../
make
make test/fast
[INPUT]
Name mem
Tag mem.local
[OUTPUT]
Name stdout
Match *
[FILTER]
Name record_modifier
Match *
Add_record HostnameAB ${HOST}
[INPUT]
Name mem
Tag mem.local
[OUTPUT]
Name stdout
Match *
[FILTER]
Name record_modifier
Match *
Rename_key Swap.total Swap.XXXX
Rename_key Swap.used Swap.YYYY
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment