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
Connecting a Log Source
1
Open Data Sources
Navigate to your cluster → Settings → Data Sources.
2
Select Log Source
Choose Log Source in the sidebar (requires the
log_source feature flag for your organisation).3
Pick a provider
Select Grafana Loki, Elasticsearch, or OpenSearch.
4
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.
5
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
6
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
7
Test and save
Click Test connection, then Save. The sidebar status dot turns green when the background health probe succeeds.
Field mappings (Elasticsearch / OpenSearch)
If you ship logs with Fluent Bit’s kubernetes filter, the defaults usually work:
Override these in the Advanced field mappings section when your index template uses different names.
For Loki, structured filters use label names (defaults:
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