Log sources let Ankra query your aggregated log store through the cluster agent. This powers the Search tab on the cluster Logs page and the AI Assistant’s
query_logs / get_log_labels tools.Why Connect a Log Source?
When you connect a log source to Ankra:- Historical log search - Query logs across pods and namespaces without leaving the cluster view
- AI-powered troubleshooting - Ankra AI can search Loki, Elasticsearch or OpenSearch during incident analysis
- Complements live streaming - Use Live stream for tailing current pod output; use Search for time-ranged queries over your log store
- Agent-mediated access - Queries run from inside your cluster, so in-cluster Loki/Elastic endpoints and external SaaS endpoints both work when the agent can reach them
Supported Providers
| Provider | Typical in-cluster endpoint | Auth |
|---|---|---|
| Grafana Loki | http://loki-gateway.monitoring.svc:80 | Bearer token; optional X-Scope-OrgID for multi-tenant Loki / Grafana Cloud |
| Elasticsearch | https://elasticsearch.logging.svc:9200 | API key (recommended) or basic auth |
| OpenSearch | https://opensearch.logging.svc:9200 | Bearer token or basic auth |
Connecting a Log Source
Select Log Source
Choose Log Source in the sidebar (requires the
log_source feature flag for your organisation).Enter the endpoint
Provide the HTTP endpoint reachable from the Ankra agent inside the cluster.Examples:For Grafana Cloud Loki, use the tenant query URL from your Grafana Cloud stack.
Configure provider options
- Loki - Optional tenant ID (
X-Scope-OrgID) for multi-tenant deployments - Elasticsearch / OpenSearch - Index pattern (default
*) and optional field mappings if your shipper uses non-standard field names - Verify TLS certificate - Enable when the endpoint presents a publicly trusted or cluster-trusted certificate; leave off for self-signed in-cluster endpoints
Add credentials (if required)
Choose the auth type that matches your deployment:
- API Token - Bearer token (Loki, OpenSearch, Grafana Cloud)
- API Key - Elasticsearch
Authorization: ApiKey …header - User Account - HTTP basic auth
Field mappings (Elasticsearch / OpenSearch)
If you ship logs with Fluent Bit’s kubernetes filter, the defaults usually work:| Logical field | Default path |
|---|---|
| Timestamp | @timestamp |
| Message | message |
| Namespace | kubernetes.namespace_name |
| Pod | kubernetes.pod_name |
| Container | kubernetes.container_name |
namespace, pod, container for Promtail/Alloy).
Searching logs in the portal
- Open Logs in the cluster sidebar
- Switch to the Search tab (visible when the log source feature is enabled)
- Pick a time range and optional namespace/pod/container filters
- Enter a text search or toggle Raw query for LogQL (Loki) or JSON query-DSL (Elasticsearch/OpenSearch)
- Use Load older to page backward in time
AI Assistant
With a configured log source, Ankra AI can:query_logs- Run structured or raw queries over the connected storeget_log_labels- Discover filterable labels/fields before querying
Troubleshooting
| Symptom | Likely cause |
|---|---|
| Status dot grey | No log source saved yet |
| Status dot amber (degraded) | Credential rejected (401/403) or probe returned an error |
| Search says cluster offline | Agent not connected - live pod logs will also fail |
| Query timeout | Narrow the time range or add namespace/pod filters |
| Empty search results | Wrong index pattern or field mappings; try get_log_labels via AI or verify labels in Grafana/Kibana |