Skip to content

Commit b9b24b3

Browse files
committed
wip
1 parent 2cf11a5 commit b9b24b3

File tree

1 file changed

+35
-0
lines changed

1 file changed

+35
-0
lines changed

blog/2025-06-19/README.md

Lines changed: 35 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,35 @@
1+
# Fluent Bit Log Hashing Example
2+
3+
This lab demonstrates how to use Fluent Bit to process log lines, generate a hash for each log entry, and output the results. This is useful for anonymizing or deduplicating logs, especially in Kubernetes environments where logs are persisted in `/var/log/containers/*.log`.
4+
5+
```bash
6+
├── docker-compose.yml # Runs Fluent Bit in a container using the provided configuration.
7+
├── fluent-bit.yaml # Fluent Bit pipeline configuration
8+
└── hash-process-sample.py # Python script that demonstrates how to hash a log line using SHA-256, matching the logic in the Fluent Bit pipeline.
9+
```
10+
11+
## Running the Lab
12+
13+
```sh
14+
docker compose up --watch
15+
```
16+
17+
You should see output similar to:
18+
19+
```json
20+
{"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","_id":"19a93f55808eb5478c65813c028045f1b354abe12790eb8aee0dd825697aa93e"}
21+
```
22+
23+
## Hash Verification
24+
25+
You can verify the hash using the provided Python script:
26+
27+
```sh
28+
python3 hash-process-sample.py
29+
```
30+
31+
The output should match the `_id` field in the Fluent Bit output.
32+
33+
## References
34+
35+
- [Fluent Bit Documentation](https://docs.fluentbit.io/)

0 commit comments

Comments
 (0)