I have a multi-tenant Loki and need to configure Alloy to set X-Scope-OrgID
dynamically from log metadata (for example tenant attribute) so each log is stored under the correct tenant. Do you know how can i do that?
Depending on what log agents you are using this may or may not be possible. Personally I think it’s a bad idea. In my opinion org ID (or tenant) should be used for organizational separation of your logs, not logical separate based on log data. You also must set the org ID when ingesting logs, you cannot set it after the fact.
Thanks for the response! I wanted to send logs from all of our systems to a single alloy, and then extract the tenant from the logs attributes, do you think that is a bad approach? should I have 1 alloy for each system/tenant?
Can you be a bit more specific and perhaps provide some examples? What kind of information from a log line would you extract to use as tenant?