Forum Discussion
Delete individual logs - iRule
I want to send emails from my iRule. And I am and it's working.
I have an iRule that writes logs. I have an alert that sends an email when it sees a matching log. So far, so good.
But I don't want my log file to be full of these emails. So in my alert, I also want to delete the log. I'm doing it like this:
exec command="sed -i 's/.*SENDMAIL.*[\r\n]*//' /var/log/ltm";
This does remove the line. But then I can't write any more logs. Why is that and how can I prevent / fix it?
1 Reply
- Hamish
Cirrocumulus
Basically you're rewriting the ltm logfile and creating a new one. Meanwhile the logs are still going to the old file.
I'd add some logic to your alerting myself to make sure you track when the last alert was sent, and only send one per XX minutes...
H
Help guide the future of your DevCentral Community!
What tools do you use to collaborate? (1min - anonymous)Recent Discussions
Related Content
* Getting Started on DevCentral
* Community Guidelines
* Community Terms of Use / EULA
* Community Ranking Explained
* Community Resources
* Contact the DevCentral Team
* Update MFA on account.f5.com