Results 1 to 2 of 2
I am monitoring a log with swatch and cannot figure out how to pull a number from the line I am watching for and insert it into the subject on ...
Enjoy an ad free experience by logging in. Not a member yet? Register.
- 03-14-2011 #1Just Joined!
- Join Date
- Mar 2011
- Posts
- 2
SWATCH Configuration: Dynamic Subject
I am monitoring a log with swatch and cannot figure out how to pull a number from the line I am watching for and insert it into the subject on an email.
For example:
Line = "I want to pull this number 123456 and put it in the subject of my email sent by swatch"
I have tried the below and other variations to no avail.
Code:watchfor /I want to pull this number [0-9]{6} and put it in the subject of my email sent by swatch/ exec echo $0 | mail -s "The number is " $7 email[at symbol]blah.comAny help would be most appreciated, thanks.Code:watchfor /I want to pull this number [0-9]{6} and put it in the subject of my email sent by swatch/ mail addresses=email[at symbol]blah.com,subject=The number is $7
- 03-14-2011 #2Just Joined!
- Join Date
- Mar 2011
- Posts
- 2
It looks like I could use the 'pipe' command
But I cannot get this to work ... I haven't found any examples online that work. Has anyone successfully used the pipe command?pipe command[,keep_open]
Pipe matched lines into command. Use the keep_open option to force the pipe to stay open until a different pipe action is run or until swatch exits.


Reply With Quote
