New to Kestra?
Use blueprints to kickstart your first workflows.
Count yesterday's ERROR logs in OpenSearch with one size-zero query and post the total to Slack daily with Kestra. Date math window, no documents moved.
Error counts belong in the channel, not in a dashboard nobody opens. This blueprint runs one io.kestra.plugin.opensearch.Search against an application logs index with size: 0, so OpenSearch returns only the total hit count for yesterday's level: ERROR documents, and posts that number to Slack. The date window uses OpenSearch date math (now-1d/d to now/d), so the query needs no templating and the same request body works in Dev Tools.
count_errors (io.kestra.plugin.opensearch.Search) queries the app-logs index with a bool filter combining term on level: ERROR and a range on @timestamp rounded to yesterday's calendar day. With size: 0, no documents are fetched and the count arrives as {{ outputs.count_errors.total }}.notify posts the total to Slack as a plain scalar inside the JSON payload.errors block posts a distinct Slack alert when the search fails, so a missing digest is never read as zero errors.Schedule trigger runs the digest daily at 07:00.The query is one request, but the digest is a routine: run at the same time daily, retry through a cluster blip, tell the channel the number, and raise a different signal when the query itself breaks. Kestra declares all of that in a few lines, keeps every count in the execution history so you can trace a trend backwards, and turns the total into an output any downstream task can gate on.
level and @timestamp fields, app-logs by default.OPENSEARCH_HOST: OpenSearch endpoint, for example https://opensearch.example.com:9200.OPENSEARCH_USERNAME: OpenSearch username.OPENSEARCH_PASSWORD: OpenSearch password.SLACK_WEBHOOK_URL: Slack incoming webhook URL.level field to match your log schema.disabled: false on the daily trigger.terms aggregation and fetchType: FETCH_ONE to read the buckets.io.kestra.plugin.core.flow.If to escalate loud days, as shown in the OpenSearch error spike gate blueprint.