Query Loki using Natural Language
mainThe Loki MCP server allows AI assistants to map natural language terms to specific Loki query parameters.
Organization/Tenant Mapping
Terms like organization, org, tenant, or organization ID are automatically mapped to the org parameter, which is sent as the X-Scope-OrgID header.
Examples of effective prompts:
- "Query Loki for logs from organization 'tenant-123' with the query {job="varlogs"}"
- "Find all logs from customer organization 'customer-xyz' for the last hour"
- "Switch to organization 'dev-team' and query {job="logs"}"
General Querying
Users can specify queries, time ranges, and limits naturally:
- "Find error logs from the last hour in Loki using query {job="varlogs"} |= "ERROR""
- "Show me the most recent 50 logs from Loki with job=varlogs"
- "Query Loki for organization 'prod-cluster' from 2 hours ago to now with limit 50"