feat: Fluentbit investigation
This commit is contained in:
parent
b46566280d
commit
e10b76a46b
6
data/fluentd/Dockerfile-dev
Normal file
6
data/fluentd/Dockerfile-dev
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
FROM fluent/fluent-bit:1.9.0
|
||||||
|
COPY fluentbit-dev.conf /tmp/fluentbit.conf
|
||||||
|
ENTRYPOINT ["/fluent-bit/bin/fluent-bit", "-c", "/tmp/fluentbit.conf"]
|
||||||
|
# USER root
|
||||||
|
# RUN ["gem", "install", "fluent-plugin-mongo"]
|
||||||
|
# USER fluent
|
24
data/fluentd/fluentbit-dev.conf
Normal file
24
data/fluentd/fluentbit-dev.conf
Normal file
@ -0,0 +1,24 @@
|
|||||||
|
[INPUT]
|
||||||
|
Name forward
|
||||||
|
Listen 0.0.0.0
|
||||||
|
Port 24224
|
||||||
|
Buffer_Chunk_Size 32KB
|
||||||
|
Buffer_Max_Size 64KB
|
||||||
|
|
||||||
|
[OUTPUT]
|
||||||
|
Name influxdb
|
||||||
|
Match *
|
||||||
|
Host coolify-influxdb
|
||||||
|
Port 8086
|
||||||
|
Bucket containerlogs
|
||||||
|
Org organization
|
||||||
|
HTTP_Token supertoken
|
||||||
|
Sequence_Tag _seq
|
||||||
|
Tag_Keys container_name
|
||||||
|
[OUTPUT]
|
||||||
|
Name http
|
||||||
|
Match *
|
||||||
|
Host host.docker.internal
|
||||||
|
Port 3000
|
||||||
|
URI /logs.json
|
||||||
|
Format json
|
@ -6,7 +6,7 @@
|
|||||||
|
|
||||||
<match **>
|
<match **>
|
||||||
@type http
|
@type http
|
||||||
endpoint http://172.17.0.1:3000/logs.json
|
endpoint http://host.docker.internal:3000/logs.json
|
||||||
<buffer>
|
<buffer>
|
||||||
flush_at_shutdown true
|
flush_at_shutdown true
|
||||||
flush_mode immediate
|
flush_mode immediate
|
@ -11,7 +11,24 @@ services:
|
|||||||
published: 6379
|
published: 6379
|
||||||
protocol: tcp
|
protocol: tcp
|
||||||
mode: host
|
mode: host
|
||||||
|
# fluentbit:
|
||||||
|
# container_name: coolify-fluentbit
|
||||||
|
# build:
|
||||||
|
# context: ./data/fluentd
|
||||||
|
# dockerfile: Dockerfile-dev
|
||||||
|
# ports:
|
||||||
|
# - target: 24224
|
||||||
|
# published: 24224
|
||||||
|
# protocol: tcp
|
||||||
|
# mode: host
|
||||||
|
# - target: 24224
|
||||||
|
# published: 24224
|
||||||
|
# protocol: udp
|
||||||
|
# mode: host
|
||||||
|
# networks:
|
||||||
|
# - coolify-infra
|
||||||
|
# extra_hosts:
|
||||||
|
# - 'host.docker.internal:host-gateway'
|
||||||
networks:
|
networks:
|
||||||
coolify-infra:
|
coolify-infra:
|
||||||
attachable: true
|
attachable: true
|
||||||
|
@ -1,8 +1,16 @@
|
|||||||
import type { RequestHandler } from '@sveltejs/kit';
|
import type { RequestHandler } from '@sveltejs/kit';
|
||||||
|
import * as db from '$lib/database';
|
||||||
|
|
||||||
export const post: RequestHandler = async (event) => {
|
export const post: RequestHandler = async (event) => {
|
||||||
const data = await event.request.json();
|
const data = await event.request.json();
|
||||||
console.log(data);
|
for (const d of data) {
|
||||||
|
if (d.container_name) {
|
||||||
|
const { log, container_name: containerId, source } = d;
|
||||||
|
console.log(log);
|
||||||
|
// await db.prisma.applicationLogs.create({ data: { log, containerId: containerId.substr(1), source } });
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
return {
|
return {
|
||||||
status: 200,
|
status: 200,
|
||||||
body: {}
|
body: {}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user