Hi Rich,
Please try with the following regex ^.*\((.*)\s*bytes free\).*$.
^ -> key/value data start..* -> anything.\) -> the parentheses character.(.*) -> capture anything after the parentheses.\s*bytes free\).* -> until this pattern (space, “bytes free”, parentheses, anything).
I left a full job definition example:
- defaultTab: nodes
description: ''
executionEnabled: true
id: 6b2400f4-ae38-4678-aefd-5cb98a66423b
loglevel: INFO
name: REGEX
nodeFilterEditable: false
plugins:
ExecutionLifecycle: null
scheduleEnabled: true
sequence:
commands:
- fileExtension: .sh
interpreterArgsQuoted: false
plugins:
LogFilter:
- config:
invalidKeyPattern: \s|\$|\{|\}|\\
logData: 'true'
name: mydata
regex: ^.*\((.*)\s*bytes free\).*$
type: key-value-data
script: |-
echo " 11 drwx 16384 May 12 2021 04:35:38 +01:00 lost+found"
echo " 7713 drwx 4096 May 12 2021 04:35:42 +01:00 .prst_sync"
echo " 12 -rw- 467842664 Oct 29 2021 00:32:17 +01:00 universalk9_npe.x.y.z.SPA.bin"
echo "23137 drwx 253952 Dec 17 2021 08:24:44 +00:00 tracelogs"
echo "38561 drwx 4096 Nov 19 2021 01:07:29 +00:00 .installer"
echo " 13 -rw- 1180 May 12 2021 05:23:33 +01:00 FOC2517R03M_2023453542_5434536.lic"
echo "30849 drwx 4096 Nov 19 2021 00:57:51 +00:00 core"
echo "53985 drwx 4096 May 12 2021 05:30:33 +01:00 .rollback_timer"
echo "61697 drwx 4096 May 12 2021 05:39:50 +01:00 .dbpersist"
echo "30850 drwx 4096 May 12 2021 05:33:51 +01:00 onep"
echo " 15 -rw- 1183 Oct 19 2021 13:09:29 +01:00 FOC2517R03M_1886.2.lic"
echo " 16 -rw- 1178 Oct 19 2021 13:09:42 +01:00 FOC2517R03M_1886222.lic"
echo " 17 -rw- 467275561 Oct 19 2021 13:11:18 +01:00 universalk9_npe.x.y.z.SPA.bin"
echo "61699 drwx 4096 Nov 19 2021 01:11:58 +00:00 license_evlog"
echo "1241329664 bytes total (234946560 bytes free)"
scriptInterpreter: /bin/bash
keepgoing: false
strategy: node-first
uuid: 6b2400f4-ae38-4678-aefd-5cb98a66423b
Check the final result here.
Hope it helps.