[api]
enabled = true
address = "0.0.0.0:8686"

[sources.tabby_server_logs]
type = "file"
include = ["/data/logs/tabby-server/events.*.log"]

[transforms.process_tabby_server_events]
type = "remap"
inputs = [ "tabby_server_logs" ]
source = """
record = parse_json!(.message).record

id = {
  "process_id": record.process.id,
  "thread_id": record.thread.id,
  "timestamp": record.time.timestamp
}

. = {
  "id": id,
  "data": parse_json!(record.message)
}
"""

[sinks.write_tabby_server_events]
type = "file"
inputs = [ "process_tabby_server_events" ]
encoding = { codec = "json" }
framing = { method = "newline_delimited" }
path = "/data/logs/events/tabby-server/%Y-%m-%d.json"
