This repository has been archived by the owner on Apr 24, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 76
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Signed-off-by: Eduardo Silva <[email protected]>
- Loading branch information
Showing
10 changed files
with
497 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,81 @@ | ||
FROM debian:stretch as builder | ||
|
||
# Fluent Bit version | ||
ENV FLB_MAJOR 1 | ||
ENV FLB_MINOR 0 | ||
ENV FLB_PATCH 0 | ||
ENV FLB_VERSION 1.0.0 | ||
|
||
ENV DEBIAN_FRONTEND noninteractive | ||
|
||
ENV FLB_TARBALL https://github.com/fluent/fluent-bit/archive/master.zip | ||
RUN mkdir -p /fluent-bit/bin /fluent-bit/etc /fluent-bit/log /tmp/fluent-bit-master/ | ||
|
||
RUN apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
build-essential \ | ||
cmake \ | ||
make \ | ||
wget \ | ||
unzip \ | ||
libssl1.0-dev \ | ||
libasl-dev \ | ||
libsasl2-dev \ | ||
pkg-config \ | ||
libsystemd-dev \ | ||
zlib1g-dev \ | ||
ca-certificates \ | ||
&& wget -O "/tmp/fluent-bit-master.zip" ${FLB_TARBALL} \ | ||
&& cd /tmp && unzip "fluent-bit-master.zip" \ | ||
&& cd "fluent-bit-master"/build/ \ | ||
&& rm -rf /tmp/fluent-bit-master/build/* | ||
|
||
WORKDIR /tmp/fluent-bit-master/build/ | ||
RUN cmake -DFLB_DEBUG=On \ | ||
-DFLB_TRACE=Off \ | ||
-DFLB_JEMALLOC=On \ | ||
-DFLB_TLS=On \ | ||
-DFLB_SHARED_LIB=Off \ | ||
-DFLB_EXAMPLES=Off \ | ||
-DFLB_HTTP_SERVER=On \ | ||
-DFLB_IN_SYSTEMD=On \ | ||
-DFLB_OUT_KAFKA=On .. | ||
|
||
RUN make -j $(getconf _NPROCESSORS_ONLN) | ||
RUN install bin/fluent-bit /fluent-bit/bin/ | ||
|
||
# Configuration files | ||
COPY fluent-bit.conf \ | ||
parsers.conf \ | ||
parsers_java.conf \ | ||
parsers_extra.conf \ | ||
parsers_openstack.conf \ | ||
parsers_cinder.conf \ | ||
plugins.conf \ | ||
/fluent-bit/etc/ | ||
|
||
FROM gcr.io/distroless/cc | ||
MAINTAINER Eduardo Silva <[email protected]> | ||
LABEL Description="Fluent Bit docker image" Vendor="Fluent Organization" Version="1.1" | ||
|
||
COPY --from=builder /usr/lib/x86_64-linux-gnu/*sasl* /usr/lib/x86_64-linux-gnu/ | ||
COPY --from=builder /usr/lib/x86_64-linux-gnu/libz* /usr/lib/x86_64-linux-gnu/ | ||
COPY --from=builder /lib/x86_64-linux-gnu/libz* /lib/x86_64-linux-gnu/ | ||
COPY --from=builder /usr/lib/x86_64-linux-gnu/libssl.so* /usr/lib/x86_64-linux-gnu/ | ||
COPY --from=builder /usr/lib/x86_64-linux-gnu/libcrypto.so* /usr/lib/x86_64-linux-gnu/ | ||
# These below are all needed for systemd | ||
COPY --from=builder /lib/x86_64-linux-gnu/libsystemd* /lib/x86_64-linux-gnu/ | ||
COPY --from=builder /lib/x86_64-linux-gnu/libselinux.so* /lib/x86_64-linux-gnu/ | ||
COPY --from=builder /lib/x86_64-linux-gnu/liblzma.so* /lib/x86_64-linux-gnu/ | ||
COPY --from=builder /usr/lib/x86_64-linux-gnu/liblz4.so* /usr/lib/x86_64-linux-gnu/ | ||
COPY --from=builder /lib/x86_64-linux-gnu/libgcrypt.so* /lib/x86_64-linux-gnu/ | ||
COPY --from=builder /lib/x86_64-linux-gnu/libpcre.so* /lib/x86_64-linux-gnu/ | ||
COPY --from=builder /lib/x86_64-linux-gnu/libgpg-error.so* /lib/x86_64-linux-gnu/ | ||
|
||
COPY --from=builder /fluent-bit /fluent-bit | ||
|
||
# | ||
EXPOSE 2020 | ||
|
||
# Entry point | ||
CMD ["/fluent-bit/bin/fluent-bit", "-c", "/fluent-bit/etc/fluent-bit.conf"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,48 @@ | ||
[SERVICE] | ||
# Flush | ||
# ===== | ||
# Set an interval of seconds before to flush records to a destination | ||
Flush 5 | ||
|
||
# Daemon | ||
# ====== | ||
# Instruct Fluent Bit to run in foreground or background mode. | ||
Daemon Off | ||
|
||
# Log_Level | ||
# ========= | ||
# Set the verbosity level of the service, values can be: | ||
# | ||
# - error | ||
# - warning | ||
# - info | ||
# - debug | ||
# - trace | ||
# | ||
# By default 'info' is set, that means it includes 'error' and 'warning'. | ||
Log_Level info | ||
|
||
# Parsers_File | ||
# ============ | ||
# Specify an optional 'Parsers' configuration file | ||
Parsers_File parsers.conf | ||
Plugins_File plugins.conf | ||
|
||
# HTTP Server | ||
# =========== | ||
# Enable/Disable the built-in HTTP Server for metrics | ||
HTTP_Server Off | ||
HTTP_Listen 0.0.0.0 | ||
HTTP_Port 2020 | ||
|
||
[INPUT] | ||
Name cpu | ||
Tag cpu.local | ||
# Interval Sec | ||
# ==== | ||
# Read interval (sec) Default: 1 | ||
Interval_Sec 1 | ||
|
||
[OUTPUT] | ||
Name stdout | ||
Match * |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,101 @@ | ||
[PARSER] | ||
Name apache | ||
Format regex | ||
Regex ^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$ | ||
Time_Key time | ||
Time_Format %d/%b/%Y:%H:%M:%S %z | ||
|
||
[PARSER] | ||
Name apache2 | ||
Format regex | ||
Regex ^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>.*)")?$ | ||
Time_Key time | ||
Time_Format %d/%b/%Y:%H:%M:%S %z | ||
|
||
[PARSER] | ||
Name apache_error | ||
Format regex | ||
Regex ^\[[^ ]* (?<time>[^\]]*)\] \[(?<level>[^\]]*)\](?: \[pid (?<pid>[^\]]*)\])?( \[client (?<client>[^\]]*)\])? (?<message>.*)$ | ||
|
||
[PARSER] | ||
Name nginx | ||
Format regex | ||
Regex ^(?<remote>[^ ]*) (?<host>[^ ]*) (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$ | ||
Time_Key time | ||
Time_Format %d/%b/%Y:%H:%M:%S %z | ||
|
||
[PARSER] | ||
Name json | ||
Format json | ||
Time_Key time | ||
Time_Format %d/%b/%Y:%H:%M:%S %z | ||
|
||
[PARSER] | ||
Name docker | ||
Format json | ||
Time_Key time | ||
Time_Format %Y-%m-%dT%H:%M:%S.%L | ||
Time_Keep On | ||
# Command | Decoder | Field | Optional Action | ||
# =============|==================|================= | ||
Decode_Field_As escaped log | ||
Decode_Field_As escaped stream | ||
|
||
[PARSER] | ||
Name docker-daemon | ||
Format regex | ||
Regex time="(?<time>[^ ]*)" level=(?<level>[^ ]*) msg="(?<msg>[^ ].*)" | ||
Time_Key time | ||
Time_Format %Y-%m-%dT%H:%M:%S.%L | ||
Time_Keep On | ||
|
||
[PARSER] | ||
Name syslog-rfc5424 | ||
Format regex | ||
Regex ^\<(?<pri>[0-9]{1,5})\>1 (?<time>[^ ]+) (?<host>[^ ]+) (?<ident>[^ ]+) (?<pid>[-0-9]+) (?<msgid>[^ ]+) (?<extradata>(\[(.*)\]|-)) (?<message>.+)$ | ||
Time_Key time | ||
Time_Format %Y-%m-%dT%H:%M:%S.%L | ||
Time_Keep On | ||
|
||
[PARSER] | ||
Name syslog-rfc3164-local | ||
Format regex | ||
Regex ^\<(?<pri>[0-9]+)\>(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? *(?<message>.*)$ | ||
Time_Key time | ||
Time_Format %b %d %H:%M:%S | ||
Time_Keep On | ||
|
||
[PARSER] | ||
Name syslog-rfc3164 | ||
Format regex | ||
Regex /^\<(?<pri>[0-9]+)\>(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<host>[^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? *(?<message>.*)$/ | ||
Time_Key time | ||
Time_Format %b %d %H:%M:%S | ||
Time_Format %Y-%m-%dT%H:%M:%S.%L | ||
Time_Keep On | ||
|
||
[PARSER] | ||
Name mongodb | ||
Format regex | ||
Regex ^(?<time>[^ ]*)\s+(?<severity>\w)\s+(?<component>[^ ]+)\s+\[(?<context>[^\]]+)]\s+(?<message>.*?) *(?<ms>(\d+))?(:?ms)?$ | ||
Time_Format %Y-%m-%dT%H:%M:%S.%L | ||
Time_Keep On | ||
Time_Key time | ||
|
||
[PARSER] | ||
# http://rubular.com/r/tjUt3Awgg4 | ||
Name cri | ||
Format regex | ||
Regex ^(?<time>[^ ]+) (?<stream>stdout|stderr) (?<logtag>[^ ]*) (?<message>.*)$ | ||
Time_Key time | ||
Time_Format %Y-%m-%dT%H:%M:%S.%L%z | ||
|
||
[PARSER] | ||
Name kube-custom | ||
Format regex | ||
Regex (?<tag>[^.]+)?\.?(?<pod_name>[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(?:\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace_name>[^_]+)_(?<container_name>.+)-(?<docker_id>[a-z0-9]{64})\.log$ | ||
|
||
[PARSER] | ||
Name filter-kube-test | ||
Format regex | ||
Regex (?<tag>[^.]+)?\.?(?<pod_name>[a-z0-9](?:[-a-z0-9]*[a-z0-9])?(?:\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace_name>[^_]+)_(?<container_name>.+)-(?<docker_id>[a-z0-9]{64})\.log$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,92 @@ | ||
[PARSER] | ||
Name ssh | ||
Format regex | ||
Regex ^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$ | ||
Time_Key time | ||
Time_Format %d/%b/%Y:%H:%M:%S %z | ||
|
||
[PARSER] | ||
Name apache2 | ||
Format regex | ||
Regex ^(?<host>[^ ]*) [^ ]* (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^ ]*) +\S*)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$ | ||
Time_Key time | ||
Time_Format %d/%b/%Y:%H:%M:%S %z | ||
|
||
[PARSER] | ||
Name apache_error | ||
Format regex | ||
Regex ^\[[^ ]* (?<time>[^\]]*)\] \[(?<level>[^\]]*)\](?: \[pid (?<pid>[^\]]*)\])?( \[client (?<client>[^\]]*)\])? (?<message>.*)$ | ||
|
||
[PARSER] | ||
Name nginx | ||
Format regex | ||
Regex ^(?<remote>[^ ]*) (?<host>[^ ]*) (?<user>[^ ]*) \[(?<time>[^\]]*)\] "(?<method>\S+)(?: +(?<path>[^\"]*?)(?: +\S*)?)?" (?<code>[^ ]*) (?<size>[^ ]*)(?: "(?<referer>[^\"]*)" "(?<agent>[^\"]*)")?$ | ||
Time_Key time | ||
Time_Format %d/%b/%Y:%H:%M:%S %z | ||
|
||
[PARSER] | ||
Name json | ||
Format json | ||
Time_Key time | ||
Time_Format %d/%b/%Y:%H:%M:%S %z | ||
|
||
[PARSER] | ||
Name docker | ||
Format json | ||
Time_Key time | ||
Time_Format %Y-%m-%dT%H:%M:%S.%L | ||
Time_Keep On | ||
# Command | Decoder | Field | Optional Action | ||
# =============|==================|================= | ||
Decode_Field_As escaped log | ||
|
||
[PARSER] | ||
Name docker-daemon | ||
Format regex | ||
Regex time="(?<time>[^ ]*)" level=(?<level>[^ ]*) msg="(?<msg>[^ ].*)" | ||
Time_Key time | ||
Time_Format %Y-%m-%dT%H:%M:%S.%L | ||
Time_Keep On | ||
|
||
[PARSER] | ||
Name syslog-rfc5424 | ||
Format regex | ||
Regex ^\<(?<pri>[0-9]{1,5})\>1 (?<time>[^ ]+) (?<host>[^ ]+) (?<ident>[^ ]+) (?<pid>[-0-9]+) (?<msgid>[^ ]+) (?<extradata>(\[(.*)\]|-)) (?<message>.+)$ | ||
Time_Key time | ||
Time_Format %Y-%m-%dT%H:%M:%S.%L | ||
Time_Keep On | ||
|
||
[PARSER] | ||
Name syslog-rfc3164-local | ||
Format regex | ||
Regex ^\<(?<pri>[0-9]+)\>(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? *(?<message>.*)$ | ||
Time_Key time | ||
Time_Format %b %d %H:%M:%S | ||
Time_Keep On | ||
|
||
[PARSER] | ||
Name syslog-rfc3164 | ||
Format regex | ||
Regex /^\<(?<pri>[0-9]+)\>(?<time>[^ ]* {1,2}[^ ]* [^ ]*) (?<host>[^ ]*) (?<ident>[a-zA-Z0-9_\/\.\-]*)(?:\[(?<pid>[0-9]+)\])?(?:[^\:]*\:)? *(?<message>.*)$/ | ||
Time_Key time | ||
Time_Format %b %d %H:%M:%S | ||
Time_Format %Y-%m-%dT%H:%M:%S.%L | ||
Time_Keep On | ||
|
||
[PARSER] | ||
Name mongodb | ||
Format regex | ||
Regex ^(?<time>[^ ]*)\s+(?<severity>\w)\s+(?<component>[^ ]+)\s+\[(?<context>[^\]]+)]\s+(?<message>.*?) *(?<ms>(\d+))?(:?ms)?$ | ||
Time_Format %Y-%m-%dT%H:%M:%S.%L | ||
Time_Keep On | ||
Time_Key time | ||
|
||
[PARSER] | ||
Name kube-custom | ||
Format regex | ||
Regex var\.log\.containers\.(?<pod_name>[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace_name>[^_]+)_(?<container_name>.+)-(?<docker_id>[a-z0-9]{64})\.log$ | ||
|
||
[PARSER] | ||
Name filter-kube-test | ||
Format regex | ||
Regex .*kubernetes.(?<pod_name>[a-z0-9]([-a-z0-9]*[a-z0-9])?(\.[a-z0-9]([-a-z0-9]*[a-z0-9])?)*)_(?<namespace_name>[^_]+)_(?<container_name>.+)-(?<docker_id>[a-z0-9]{64})\.log$ |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
|
||
[PARSER] | ||
# http://rubular.com/r/IvZVElTgNl | ||
Name ceph | ||
Format regex | ||
Regex ^(?<log_time>[^ ][-.\d\+:T]+[ ]*[.:\d]*)\s+(?<message>.*)$ | ||
Time_Format %Y-%m-%d %H:%M:%S.%L | ||
Time_Keep Off | ||
Time_Key log_time | ||
|
Oops, something went wrong.