Reputation: 31
I need the RegEx command to get all the lines which DO NOT have the job name containing "filewatch". Any help will be greatly appreciated! Thanks.
STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-05-ftpfilewatcher
STATUS: FAILURE JOB: i3-cur-atmrec-pd-TD_FTP_Forecast_File_Del_M_Su
ALARM: JOBFAILURE JOB: i3-cur-atmrec-pd-TD_FTP_Forecast_File_Del_M_Su
STATUS: FAILURE JOB: i3-sss-system-heartbeat
ALARM: JOBFAILURE JOB: i3-sss-system-heartbeat
STATUS: FAILURE JOB: i3-chq-cspo-pd-batch-daily-renametable-fileok
STATUS: FAILURE JOB: i3-chq-cspo-pd-batch-daily-renametable-file
ALARM: JOBFAILURE JOB: i3-chq-cspo-pd-batch-daily-renametable-fileok
ALARM: JOBFAILURE JOB: i3-chq-cspo-pd-batch-daily-renametable-file
STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-35-filewatcher
STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-05-ftpfilewatcher
STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-35-filewatcher
STATUS: FAILURE JOB: i3-imds-dcp-pd-bo1-05-ftpfilewatcher
Upvotes: 3
Views: 9528
Reputation: 655845
If your regular expression implementation supports look-ahead assertions, try this:
^(STATUS|ALARM): +(JOB)?FAILURE +JOB: ((?!filewatch).)+$
Make sure that ^
and $
match the file line begin/end.
Upvotes: 3