-
Trying to collect kafka logs using vector latest version and sending to loki. But unable to extract any labels from loglines. when given under labels i.e., |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
any help please |
Beta Was this translation helpful? Give feedback.
-
Below is the sink config I used
With this giving error function topic not defined and function host not defined though they're appearing in loglines when printed to console. Logs source is kafka |
Beta Was this translation helpful? Give feedback.
@pront Thanks for responding. I already able to fix this. But strange thing is no where defined in vector documents about labels exposure for loki sink. Found in grafana labs community
Below should be the way in exposing labels in loki sink
sinks:
loki_sink:
type: loki
inputs:
- extract_transform
endpoint: http://loki-nob-gateway
encoding:
codec: json
labels:
topic: "{{
{{topic}}
}}"region: "{{
{{region}}
}}"job: "{{
{{job}}
}}"