Example queries
Last updated
Last updated
groundcover recommends using as many "strong" filters as possible, like time filters, workload and namespaces filters, log level filters, etc.
These will help making free text and attribute searches much faster and efficient.
When querying logs in the platform it's important to distinguish between two types of queries:
- will return a single value for each group. For example, counting the amount of error logs per workload.
When to use: Threshold-based alerting or when you only need the most recent value
- will return a series of values over time. For example, counting the amount of logs per workload in 5-minute buckets.
When to use: Plotting trends over time
The query uses the count()
operator to get the number of error logs in the defined time window.
The query uses the count()
operator to get the number of logs generated by the kafkajs-events-consumer
workload, which contain the phrase Connection timeout.
Using formatted logs allows groundcover to automatically extract attributes from the log, which can then be used in alerts and dashboards.
For example, let's look at the following json-formatted log:
The following query uses the string_attributes
column to query the "http.req.method"
attribute and filter for GET
requests:
The following query will plot the count of logs grouped by a specific attribute extracted from the logs. It will arrange the counts into 5-minute buckets, showing trend over time.