-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathadvanced_example.yaml
More file actions
50 lines (38 loc) · 1.4 KB
/
advanced_example.yaml
File metadata and controls
50 lines (38 loc) · 1.4 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
# Advanced Example with Multiple Routes
routes:
# Route 1: Simple timer with transform
- name: "greeting_route"
from: "timer:10s" # Run every 10 seconds
processors:
- type: "transform"
template: "Greeting from DialogChain at {{now().isoformat() if 'now' in globals() else 'current_time'}}!"
to: "log:info"
# Route 2: Message transformation
- name: "transform_route"
from: "timer:15s" # Run every 15 seconds
processors:
- type: "transform"
template: |
{
"message": "This is a test message",
"status": "success",
"count": 1
}
- type: "transform"
template: "Processed message: {{message}} (Status: {{status}}, Count: {{count}})"
to: "log:info"
# Route 3: Conditional logging
- name: "conditional_route"
from: "timer:20s" # Run every 20 seconds
processors:
- type: "transform"
template: "test_status=failed coverage=75"
# This filter will only pass through if condition is true
- type: "filter"
condition: "{{test_status}} == 'failed' or {{coverage}} < 80"
- type: "transform"
template: "ALERT: Test {{test_status}} with {{coverage}}% coverage (below threshold)"
to: "log:warn"
# Environment variables (commented out as they're not needed for this example)
# env_vars:
# - VARIABLE_NAME