Add loki.toml
This commit is contained in:
parent
7b745ad4a8
commit
ec63d10371
|
@ -0,0 +1,54 @@
|
|||
data_dir = "/var/lib/vector/"
|
||||
|
||||
[sources.loki]
|
||||
type = "file"
|
||||
include = [ "/var/log/loki.log" ]
|
||||
read_from = "beginning"
|
||||
|
||||
[transforms.loki_transform]
|
||||
type = "remap"
|
||||
inputs = ["loki"]
|
||||
source = '''
|
||||
. |= parse_syslog!(.message)
|
||||
|
||||
. |= parse_key_value!(.message)
|
||||
|
||||
del(.message)
|
||||
del(.host)
|
||||
|
||||
.message = .msg
|
||||
del(.msg)
|
||||
'''
|
||||
|
||||
[sinks.loki_output]
|
||||
type = "file"
|
||||
inputs = [ "loki_transform" ]
|
||||
compression = "none"
|
||||
path = "/tmp/loki-%Y-%m-%d.log"
|
||||
|
||||
[sinks.loki_output.encoding]
|
||||
codec = "json"
|
||||
|
||||
[sinks.loki_output.buffer]
|
||||
max_size = 268435488
|
||||
type = "disk"
|
||||
|
||||
[sinks.loki_loki]
|
||||
type = "loki"
|
||||
inputs = [ "loki_transform" ]
|
||||
endpoint = "http://loki.service.consul:3100"
|
||||
compression = "snappy"
|
||||
out_of_order_action = "accept"
|
||||
|
||||
[sinks.loki_loki.labels]
|
||||
level = "{{ level }}"
|
||||
hostname = "{{ hostname }}"
|
||||
job = "loki"
|
||||
filename = "/var/log/loki.log"
|
||||
|
||||
[sinks.loki_loki.encoding]
|
||||
codec = "json"
|
||||
|
||||
[sinks.loki_loki.buffer]
|
||||
max_size = 268435488
|
||||
type = "disk"
|
Loading…
Reference in New Issue