Hi,
I have a third party process running on a unix box that writes to a log file. The log file is automatically updated every 30 seconds with various stats etc. This file is monitored by another application to see if various errors occur and raised alerts if any are found.
I want to test this to ensure the appropriate alerts are generated but am having an issue. An alert should be generated if a line contains the word "Error". So what I am doing is: echo "Error: This is a test" >> process.log. I can then do a grep -i Error process.log and see my error. However no alert is generated. Then when the automatic update is due to happen if I run the grep -i Error process.log command again I can no longer see the message I echoed into the file.
I have done a tail -f of the process.log also and can see my Error message after I echo it in, however, when the automatic update occurs it appears that my message gets overwritten but the lines above where it is remain the same.
I have tried the same using cat to redirect the message from file into the log but with the same results.
Why is this happening? Does anyone know how I can force this message to stay in the log file?
Thanks,
Toddyl
I have a third party process running on a unix box that writes to a log file. The log file is automatically updated every 30 seconds with various stats etc. This file is monitored by another application to see if various errors occur and raised alerts if any are found.
I want to test this to ensure the appropriate alerts are generated but am having an issue. An alert should be generated if a line contains the word "Error". So what I am doing is: echo "Error: This is a test" >> process.log. I can then do a grep -i Error process.log and see my error. However no alert is generated. Then when the automatic update is due to happen if I run the grep -i Error process.log command again I can no longer see the message I echoed into the file.
I have done a tail -f of the process.log also and can see my Error message after I echo it in, however, when the automatic update occurs it appears that my message gets overwritten but the lines above where it is remain the same.
I have tried the same using cat to redirect the message from file into the log but with the same results.
Why is this happening? Does anyone know how I can force this message to stay in the log file?
Thanks,
Toddyl