reaction/tests/notif-no-pattern.jsonnet
ppom bba113b6ab
Remove newline at the end of stream lines
Bug introduced by !24 which kept trailing `\n` and fed it to filters.
Thus regexes ending with `$` couldn't match anymore.

Fixes #128
2025-07-07 12:00:00 +02:00

42 lines
773 B
Jsonnet

{
patterns: {
num: {
regex: '[0-9]+',
ignore: ['1'],
// ignoreregex: ['2.?'],
},
},
start: [
['echo', 'coucou'],
],
stop: [
['echo', 'byebye'],
],
streams: {
s1: {
cmd: ['sh', '-c', 'seq 20 | while read i; do echo found $((i % 5)); sleep 1; done'],
filters: {
f1: {
regex: [
'^found [0-9]+$',
],
retry: 4,
retryperiod: '60s',
actions: {
damn: {
cmd: ['notify-send', 'first stream', 'found!'],
},
undamn: {
cmd: ['notify-send', 'first stream', 'unfound'],
after: '3s',
onexit: true,
},
},
},
},
},
},
}