Skip to main content
Version: 1.5.0

Cron

Synopsis

Cron-based execution allows targets and routes to run at specific times using cron expressions. Instead of running continuously, the component will only process data when the cron schedule condition is met.

Schema

Targets

targets:
- name: <string>
type: <string>
properties:
cron: <string>
# target-specific properties

Routes

routes:
- name: <string>
source: <string>
destination: <string>
properties:
cron: <string>

Configuration

FieldRequiredDefaultDescription
cronN-Cron expression defining when the component should execute

Details

The cron field accepts standard cron expressions to control when a target or route executes. This is useful for scenarios where you want to:

  • Process data at specific times of day
  • Run components during off-peak hours
  • Align execution with business schedules
  • Reduce resource consumption by limiting execution windows
  • Create time-based routing logic

When a cron schedule is configured, the component will only process queued data when the current time matches the cron expression. Between scheduled executions, data accumulates in the queue and is processed during the next scheduled window.

Cron Expression Format

Standard cron format with five fields:

┌───────────── minute (0-59)
│ ┌───────────── hour (0-23)
│ │ ┌───────────── day of month (1-31)
│ │ │ ┌───────────── month (1-12)
│ │ │ │ ┌───────────── day of week (0-6, Sunday=0)
│ │ │ │ │
* * * * *

Special Characters

  • * - Any value
  • , - Value list separator
  • - - Range of values
  • / - Step values

Time Zone

All cron expressions are evaluated in the system's local timezone.

Target Examples

Every Hour

Execute target at the start of every hour...

targets:
- name: hourly_splunk
type: splunk
properties:
cron: "0 * * * *"
endpoints:
- endpoint: "https://splunk.example.com:8088/services/collector"
token: "YOUR-TOKEN"
index: "logs"

Business Hours Only

Execute every 30 minutes between 9 AM and 5 PM on weekdays...

targets:
- name: business_hours_elastic
type: elastic
properties:
cron: "*/30 9-17 * * 1-5"
index: "business-logs"
endpoints:
- endpoint: "http://elasticsearch:9200"

Daily at Midnight

Execute once per day at midnight...

targets:
- name: daily_archive
type: awss3
properties:
cron: "0 0 * * *"
bucket: "daily-archives"
region: "us-east-1"

Multiple Times Per Day

Execute at 6 AM, 12 PM, and 6 PM every day...

targets:
- name: three_times_daily
type: splunk
properties:
cron: "0 6,12,18 * * *"
endpoints:
- endpoint: "https://splunk.example.com:8088/services/collector"
token: "YOUR-TOKEN"
index: "scheduled-logs"

Every 15 Minutes

Execute every 15 minutes throughout the day...

targets:
- name: frequent_elastic
type: elastic
properties:
cron: "*/15 * * * *"
index: "frequent-logs"
endpoints:
- endpoint: "http://elasticsearch:9200"

Weekly on Mondays

Execute every Monday at 9 AM...

targets:
- name: weekly_report
type: splunk
properties:
cron: "0 9 * * 1"
endpoints:
- endpoint: "https://splunk.example.com:8088/services/collector"
token: "YOUR-TOKEN"
index: "weekly-reports"

Month End

Execute on the last day of every month at midnight...

targets:
- name: month_end_processing
type: bigquery
properties:
cron: "0 0 28-31 * *"
project: "my-project"
dataset: "monthly_data"
tables:
- "logs"

Night Processing

Execute every 2 hours during night time (10 PM to 6 AM)...

targets:
- name: night_batch
type: clickhouse
properties:
cron: "0 22,0,2,4,6 * * *"
connection_string: "clickhouse://localhost:9000"
table: "night_logs"

Weekends Only

Execute every 4 hours on Saturday and Sunday...

targets:
- name: weekend_processing
type: elastic
properties:
cron: "0 */4 * * 0,6"
index: "weekend-logs"
endpoints:
- endpoint: "http://elasticsearch:9200"

Specific Day of Month

Execute on the 1st and 15th of every month at noon...

targets:
- name: bi_monthly
type: splunk
properties:
cron: "0 12 1,15 * *"
endpoints:
- endpoint: "https://splunk.example.com:8088/services/collector"
token: "YOUR-TOKEN"
index: "bi-monthly-logs"

Route Examples

Business Hours Routing

Route data to a specific target only during business hours...

routes:
- name: business_hours_route
source: "application_logs"
destination: "realtime_splunk"
properties:
cron: "* 9-17 * * 1-5"

- name: off_hours_route
source: "application_logs"
destination: "batch_storage"

Daily Archive Route

Route data to archive storage once per day at midnight...

routes:
- name: daily_archive_route
source: "processed_logs"
destination: "s3_archive"
properties:
cron: "0 0 * * *"

- name: realtime_route
source: "processed_logs"
destination: "elasticsearch"

Weekend Backup Route

Route data to backup target only on weekends...

routes:
- name: weekend_backup
source: "production_logs"
destination: "backup_target"
properties:
cron: "0 */6 * * 0,6"

- name: primary_route
source: "production_logs"
destination: "primary_target"

Peak Hours Dual Routing

Send data to multiple targets during peak hours for redundancy...

routes:
- name: peak_hours_primary
source: "critical_logs"
destination: "splunk_primary"
properties:
cron: "* 8-18 * * 1-5"

- name: peak_hours_secondary
source: "critical_logs"
destination: "splunk_secondary"
properties:
cron: "* 8-18 * * 1-5"

- name: off_peak_route
source: "critical_logs"
destination: "splunk_primary"

Hourly Aggregation Route

Route aggregated data every hour while streaming raw data continuously...

routes:
- name: hourly_aggregates
source: "metrics"
destination: "bigquery_aggregates"
properties:
cron: "0 * * * *"

- name: realtime_metrics
source: "metrics"
destination: "elasticsearch"

Common Patterns

PatternExpressionDescription
Every minute* * * * *Run every minute
Every 5 minutes*/5 * * * *Run every 5 minutes
Every 10 minutes*/10 * * * *Run every 10 minutes
Every 30 minutes*/30 * * * *Run every 30 minutes
Every hour0 * * * *Run at the start of every hour
Every 2 hours0 */2 * * *Run every 2 hours
Every 6 hours0 */6 * * *Run every 6 hours
Daily at midnight0 0 * * *Run once per day at midnight
Daily at noon0 12 * * *Run once per day at noon
Weekly (Monday)0 0 * * 1Run every Monday at midnight
Monthly (1st)0 0 1 * *Run on the 1st of each month
Weekdays only0 9 * * 1-5Run weekdays at 9 AM
Weekends only0 9 * * 0,6Run weekends at 9 AM

Usage Notes

  • Cron takes precedence over interval if both are configured
  • Data queues up between scheduled executions
  • First execution occurs at the next matching time after component initialization
  • Failed executions do not trigger immediate retries, they wait for the next scheduled time
  • Use cron for predictable, time-based execution patterns
  • For high-frequency or continuous processing, omit cron or use interval instead
  • Multiple routes can have different cron schedules, creating time-based routing logic

Troubleshooting

Component Not Executing

Check that:

  • Cron expression is valid
  • System timezone matches your expectations
  • Component status is enabled
  • Queue contains data to process

Missed Executions

If executions are being skipped:

  • Verify the cron expression matches your intended schedule
  • Check system logs for errors during execution attempts
  • Ensure previous execution completed before next scheduled time

Timezone Issues

All cron schedules use the system's local timezone. If your logs show unexpected execution times:

  • Verify system timezone configuration
  • Consider adjusting cron expression to match your timezone
  • Document timezone expectations in component descriptions