reaction/config/heavy-load.yml
ppom b441e91f84 Add global concurrency parameter. fix #56
Fix bug which caused pending actions to be run multiple times when pending time finished
Fix bug which caused
1. past pending actions to rerun on exit
2. maximum one pending action per pattern/action couple to run on exit
2024-01-05 12:00:00 +01:00

73 lines
1.7 KiB
YAML

---
patterns:
num:
regex: '[0-9]+'
ip:
regex: '(?:(?:[0-9]{1,3}\.){3}[0-9]{1,3})|(?:[0-9a-fA-F:]{2,90})'
ignore:
- 1.0.0.1
concurrency: 0
streams:
tailDown1:
cmd: [ 'sh', '-c', 'sleep 2; seq 100010 | while read i; do echo found $(($i % 100)); done' ]
filters:
findIP:
regex:
- '^found <num>$'
retry: 50
retryperiod: 1m
actions:
damn:
cmd: [ 'sleep', '0.<num>' ]
undamn:
cmd: [ 'sleep', '0.<num>' ]
after: 1m
onexit: false
tailDown2:
cmd: [ 'sh', '-c', 'sleep 2; seq 100010 | while read i; do echo prout $(($i % 100)); done' ]
filters:
findIP:
regex:
- '^prout <num>$'
retry: 50
retryperiod: 1m
actions:
damn:
cmd: [ 'sleep', '0.<num>' ]
undamn:
cmd: [ 'sleep', '0.<num>' ]
after: 1m
onexit: false
tailDown3:
cmd: [ 'sh', '-c', 'sleep 2; seq 100010 | while read i; do echo nanana $(($i % 100)); done' ]
filters:
findIP:
regex:
- '^nanana <num>$'
retry: 50
retryperiod: 2m
actions:
damn:
cmd: [ 'sleep', '0.<num>' ]
undamn:
cmd: [ 'sleep', '0.<num>' ]
after: 1m
onexit: false
tailDown4:
cmd: [ 'sh', '-c', 'sleep 2; seq 100010 | while read i; do echo nanana $(($i % 100)); done' ]
filters:
findIP:
regex:
- '^nomatch <num>$'
retry: 50
retryperiod: 2m
actions:
damn:
cmd: [ 'sleep', '0.<num>' ]
undamn:
cmd: [ 'sleep', '0.<num>' ]
after: 1m
onexit: false