New to Kestra?
Use blueprints to kickstart your first workflows.
Automate daily log forwarding from Kestra to Splunk using the LogShipper task and Splunk LogExporter. Centralize observability, alerting, and audit trails.
id: splunk-log-shipper
namespace: system
tasks:
- id: log_export
type: io.kestra.plugin.ee.core.log.LogShipper
logLevelFilter: INFO
lookbackPeriod: P1D
offsetKey: logShipperOffset
delete: false
logExporters:
- id: SplunkLogExporter
type: io.kestra.plugin.ee.splunk.LogExporter
host: https://example.splunkcloud.com:8088
token: "{{ secret('SPLUNK_API_KEY') }}"
triggers:
- id: daily
type: io.kestra.plugin.core.trigger.Schedule
cron: "@daily"
Stream Kestra execution logs into Splunk on a daily schedule using the Enterprise Edition LogShipper task with the Splunk LogExporter. This system flow consolidates orchestration telemetry into your existing Splunk Cloud or Splunk Enterprise instance so SREs, platform teams, and security analysts can query, alert, and build dashboards on workflow activity alongside the rest of their infrastructure logs. Instead of polling Kestra's API or scraping logs by hand, the flow tracks an offset, picks up only new entries, and pushes them to Splunk's HTTP Event Collector (HEC).
daily trigger (io.kestra.plugin.core.trigger.Schedule with cron @daily) fires the flow once every 24 hours.log_export task (io.kestra.plugin.ee.core.log.LogShipper) queries Kestra logs for the past day. It uses logLevelFilter: INFO to capture INFO and higher severities, lookbackPeriod: P1D to bound the initial window, and offsetKey: logShipperOffset to persist a cursor between runs so events are never duplicated or skipped.delete: false keeps the original logs inside Kestra after shipping, preserving the in-product execution view.SplunkLogExporter (io.kestra.plugin.ee.splunk.LogExporter) posts each log event to your Splunk HEC endpoint (host) authenticated with an HEC token sourced from {{ secret('SPLUNK_API_KEY') }}.Splunk's own ingestion pipelines do not know when a Kestra execution started, retried, or failed, and they cannot reach inside Kestra to pull internal log streams. Running the shipper as a Kestra flow gives you declarative YAML, schedule and event triggers, automatic retries on transient HEC errors, full execution lineage, and the ability to chain follow-up tasks (for example, raising a PagerDuty alert) if log delivery fails. The offset key handled by LogShipper removes the need for an external bookmark store.
SPLUNK_API_KEY: Splunk HEC token used to authenticate against the HEC endpoint.SPLUNK_API_KEY as a Kestra secret in the target tenant or namespace.host value (https://example.splunkcloud.com:8088) with your real HEC endpoint.system namespace and let the @daily schedule run, or trigger it manually for the first execution.index=<your_index> in Splunk to confirm Kestra events are arriving.logLevelFilter (for example, WARN for noisy environments, DEBUG for deep troubleshooting).*/15 * * * * or @hourly for near real time shipping.logExporters to fan out the same logs to additional destinations such as Elasticsearch, Datadog, or cloud object storage.delete: true once you are confident in Splunk retention to reduce Kestra storage.errors: handlers that notify Slack or PagerDuty when shipping fails.