hello
hm support many alert way
now i create the alerts profiles use record info into hm log
action parameters is add record into specific log files
but the log files format is defined format
my log below:
[2013-12-11 19:29:28] mail server No answer ping (timeout - 2000 ms) 2397
[2013-12-11 19:31:02] mail server No answer ping (timeout - 2000 ms) 2397
[2013-12-11 19:31:55] mail server Host is alive 47 ms ping (timeout - 2000 ms) 2397
now i need to such format:
[2013-12-11 19:29:28 | mail server No answer |13707382372
notes:
because our sms platform only support format:
time | content| phone number
how to custom log format?
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact:
You may use "Execure External Program" action with command line like:
Script (D:\scripts\log.bat) may look like the following:
Code: Select all
cmd /c D:\scripts\log.bat "%DateTime%" "%TestName%" "%Status%" "%Reply%" "13707382372"
Code: Select all
SET "SEPARATOR=^|"
@echo %~1%SEPARATOR%%~2%SEPARATOR%%~3%SEPARATOR%%~4%SEPARATOR%%~5 >> D:\logs\log01.txt
-
- Posts: 2832
- Joined: Tue May 16, 2006 4:41 am
- Contact: