Skip to content

Commit 5182e4d

Browse files
committed
wip
1 parent 106b1c3 commit 5182e4d

File tree

9 files changed

+75
-2
lines changed

9 files changed

+75
-2
lines changed

blog/2025-06-19/fluent-bit.yaml

Lines changed: 8 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,10 @@ service:
88
pipeline:
99
inputs:
1010
- name: dummy
11-
dummy: '{"message": "2025-06-19T17:02:35.123456789Z stdout F This is a Foobar application log sample running in kubernetes persisted on /var/log/containers/*.log"}'
11+
dummy: |
12+
{
13+
"message": "2025-06-19T17:02:35.123456789Z stdout F This is a Foobar application log sample running in kubernetes persisted on /var/log/containers/*.log"
14+
}
1215
tag: dummy.foobar
1316
processors:
1417
logs:
@@ -22,7 +25,10 @@ pipeline:
2225
key: _id
2326

2427
- name: dummy
25-
dummy: '{"message": "2025-06-19T17:02:35.123456789Z stdout F This is a Greeting application log sample running in kubernetes persisted on /var/log/containers/*.log"}'
28+
dummy: |
29+
{
30+
"message": "2025-06-19T17:02:35.123456789Z stdout F This is a Greeting application log sample running in kubernetes persisted on /var/log/containers/*.log"
31+
}
2632
tag: dummy.greeting
2733
processors:
2834
logs:
Lines changed: 16 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
services:
2+
fluentbit:
3+
container_name: fluentbit
4+
image: fluent/fluent-bit:latest
5+
user: root
6+
volumes:
7+
- ./fluent-bit.yaml:/fluent-bit/fluent-bit.yaml
8+
develop:
9+
watch:
10+
- action: sync+restart
11+
path: ./
12+
target: /fluentbit/
13+
command:
14+
- "fluent-bit"
15+
- "-c"
16+
- "/fluent-bit/fluent-bit.yaml"

fluentbit/lift-nest/fluent-bit.yaml

Lines changed: 51 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,51 @@
1+
service:
2+
flush: 1 # Flush records every second. Controls how often data is pushed to outputs.
3+
log_level: error # Only log errors. Reduces log verbosity for Fluent Bit itself.
4+
5+
# The `pipeline.inputs.processors` feature is only available when using the `yaml` configuration format.
6+
# It is not supported in the legacy `.conf` configuration format.
7+
8+
pipeline:
9+
inputs:
10+
- name: dummy
11+
dummy: |
12+
{
13+
"foo" : "bar",
14+
"x": "123"
15+
}
16+
tag: dummy.foobar
17+
processors:
18+
logs:
19+
- name: modify
20+
add:
21+
- kubernetes.pod foobar-pod
22+
- kubernetes.node foobar-node
23+
24+
- name: nest
25+
operation: nest
26+
nest_under: app
27+
wildcard: "*"
28+
29+
- name: lua
30+
code: |
31+
function main(tag, timestamp, record)
32+
for k, v in pairs(record["app"]) do
33+
if k:find("kubernetes%.") == 1 then
34+
record[k] = v
35+
record["app"][k] = nil
36+
end
37+
end
38+
return 1, timestamp, record
39+
end
40+
call: main
41+
42+
- name: nest
43+
operation: nest
44+
nest_under: kubernetes
45+
wildcard: "kubernetes.*"
46+
remove_prefix: kubernetes.
47+
48+
outputs:
49+
- name: stdout
50+
format: json_lines
51+
match: dummy.*

0 commit comments

Comments
 (0)