Skip to main content
Version: 1.2.0

Wait

Synopsis

Introduces a time delay in the processing pipeline.

Schema

- wait:
timeout: <numeric>
description: <text>
if: <script>
ignore_failure: <boolean>
on_failure: <processor[]>
on_success: <processor[]>
tag: <string>

Configuration

The following fields are used to define the processor:

FieldRequiredDefaultDescription
timeoutY-Number of seconds to wait/pause
descriptionN-Explanatory note
ifN-Condition to run
ignore_failureNfalseContinue processing if wait fails
on_failureN-Error handling processors
on_successN-Success handling processors
tagN-Identifier

Details

Introduces a deliberate time delay (pause) in the processing pipeline. The processor waits for the specified number of seconds before allowing the pipeline to continue processing.

note

The wait processor blocks the current pipeline thread for the specified duration. During this time, other log entries can continue processing in parallel through their own pipeline instances, so overall system throughput is maintained.

The processor is useful for rate limiting, implementing backoff strategies, synchronizing with external systems, or creating deliberate delays for testing and debugging purposes.

warning

Using long timeouts can impact performance by keeping threads and resources allocated longer than necessary. For very long delays (minutes or hours), consider using a different approach such as a message queue with delayed delivery instead of the wait processor.

Examples

Basic

Introducing a simple delay...

- wait:
timeout: 5

pauses processing for 5 seconds

Conditional

Waiting only under specific conditions...

- wait:
timeout: 10
if: "logEntry.api.rate_limited == true"

delays processing for 10 seconds only when rate limited

Rates

Controling API request frequency...

- set:
field: request.timestamp
value: "{{@timestamp}}"
- http_request:
url: "https://api.example.com/data"
method: "GET"
target_field: response
- wait:
timeout: 2
- http_request:
url: "https://api.example.com/status"
method: "GET"
target_field: status

ensures 2-second spacing between API calls

Simulating Latency

Adding deliberate latency for testing...

- wait:
timeout: 3
if: "logEntry.environment == 'testing' && logEntry.simulate_latency == true"
tag: "latency_simulation"

creates artificial delay in test environments only

Backoff Strategy

Implementing a backoff increases the wait time exponentially between retry attempts

- set:
field: retry.count
value: 0
if: "!hasField(logEntry, 'retry.count')"
- set:
field: retry.delay
value: 1
if: "!hasField(logEntry, 'retry.delay')"
- http_request:
url: "https://api.example.com/data"
method: "POST"
target_field: response
on_failure:
- set:
field: retry.count
value: "{{retry.count + 1}}"
- set:
field: retry.delay
value: "{{math.pow(2, retry.count)}}"
- wait:
timeout: "{{retry.delay}}"
- drop:
if: "retry.count > 5"