Skip to content

How to specify logline/content in loki sink? #21871

Answered by 9Lucky9
9Lucky9 asked this question in Q&A
Discussion options

You must be logged in to vote

So i figured this out by doing this:

  1. I deleted another fields using a del() function like that:
del(.file)
del(.kubernetes)
del(.source_type)
del(.messageJson)
del(.stream)
  1. I added field remove_label_fields: true to loki sink.
  2. I changed encoding.codec to "text"

If this is not the preferred/best way of doing this, correct me.

Final values.yaml config:

role: Agent

logLevel: "debug"

customConfig:
  data_dir: /vector-data-dir
  api:
    enabled: true
    address: 0.0.0.0:8686
    playground: false
  sources:
    vitta_app_logs:
      type: kubernetes_logs
      extra_label_selector: "developed-by=lucky"
  transforms:
    vitta_app_logs_transform:
      type: remap
      inputs:
       …

Replies: 1 comment 1 reply

Comment options

You must be logged in to vote
1 reply
@pront
Comment options

Answer selected by 9Lucky9
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants