Monday, April 25, 2022

Loki returns no data, although there is data

 In a multi-tenant system, You'd have to specify the org-id as "undefined", or no data will come back:

    logcli --org-id="undefined" query '{your_label="your_label_value"}'



If you are using the HTTP API, you'd have to set the

X-Scope-OrgID header to "undefined". Screenshot from my Chrome's ModHeader:




Credit: Tyler Owen




Loki logcli Error response from server: no org id

Problem:

On my Mac:

    export LOKI_ADDR=the_url_of_the_loki_server 

    logcli labels

    Error response from server: no org id


Solution:

    logcli --org-id="the_tenant_id_in_a_multitenant_system" labels