Alloy config : __path__ and color

greetings @tonyswumac

any idea what this color key:value is?

loki.source.file "example" {
  // Collect logs from the default listen address.
  targets = [
    {__path__ = "/tmp/foo.txt", "color" = "pink"},
    {__path__ = "/tmp/bar.txt", "color" = "blue"},
    {__path__ = "/tmp/baz.txt", "color" = "grey"},
  ]

  forward_to = [loki.write.default.receiver]
}

I think that’s just to say that you can supply additional labels along with __path__. Maybe the documentation can be made clear by changing it to this?

targets = [
    {__path__ = "/tmp/foo.txt", "additional_label1" = "additional_label_value1"},
    {__path__ = "/tmp/bar.txt", "additional_label2" = "additional_label_value2"}},
    {__path__ = "/tmp/baz.txt", "extr_label3" = "additional_label_value3"}},
  ]
1 Like