How to Define Disk Buffer Storage Location and Customize the Path in Log Sinks? #21387
-
When we define the buffer type as 'disk,' where are the buffered logs stored? What is the default path, and how can we configure a custom path? sinks:
overflow_test:
type: blackhole
buffer:
- type: memory
max_events: 1000
when_full: overflow
- type: disk
max_size: 1073741824 # 1GiB.
when_full: drop_newest |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 4 replies
-
I configured this, and the buffer folder was created in the /vector-data-dir directory. However, even after successful delivery, the buffer retains its data and is not flushed. With this configuration, it seems the buffer will eventually fill up. Am I correct? Any solution for this? customConfig:
data_dir: "/vector-data-dir/"
api:
enabled: true
address: 127.0.0.1:8686
playground: false
sources:
file_logs:
type: "file"
include:
- "/vector-data-dir/log.log"
read_from: "beginning"
transforms:
app_logs_parser:
inputs:
- "file_logs"
type: "remap"
source: |
# Try to parse the JSON message
. = parse_json(.message) ?? null
# Check if parsing was successful
if is_null(.) {
abort # unknown type
}
# Handle two formats of logs: flat and nested
log_value =
if exists(.log) {
.log
} else {
.
}
# Merge log_value into the main object and add timestamp
. = log_value
sinks:
kafka_server:
type: "kafka"
inputs:
- "app_logs_parser"
encoding:
codec: "json"
bootstrap_servers: kafka.vector.svc.cluster.local:9092
topic: test
buffer:
type: disk
max_size: 268435488 # 256MB
when_full: block
|
Beta Was this translation helpful? Give feedback.
-
Yes, I tested it. The buffer for slink grows up to 128 MB before it's flushed. Even if slink successfully sends data to the destination (Kafka in our case), the buffer can still reach 128 MB before clearing. |
Beta Was this translation helpful? Give feedback.
Yes, I tested it. The buffer for slink grows up to 128 MB before it's flushed. Even if slink successfully sends data to the destination (Kafka in our case), the buffer can still reach 128 MB before clearing.