<div dir="auto">Yep, that would give you one logfile every day. It will not care about whether it reached 500mb though. But on the plus side that gives you a trivial way to identify which file holds a specific date, which is pretty cumbersome otherwise.</div><div class="gmail_extra"><br><div class="gmail_quote">On May 30, 2018 07:52, "Amin, Jitesh CTR DISA JSP (US)" <<a href="mailto:jitesh.amin.ctr@mail.mil">jitesh.amin.ctr@mail.mil</a>> wrote:<br type="attribution"><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">CLASSIFICATION: UNCLASSIFIED<br>
Hello,<br>
So here's what currently is configured in our .conf file:<br>
<br>
destination syslog { file("/var/log/syslog.log" perm(0644)); };<br>
<br>
what you are saying, is if I want logs to rotate on daily basis, I can just make the above line to read as following:<br>
<br>
destination syslog { file("/var/log/syslog-${YEAR}-<wbr>${MONTH}-${DAY}.log"); };<br>
<br>
<br>
Thanks<br>
Jitesh Amin<br>
<br>
<br>
CLASSIFICATION: UNCLASSIFIED<br>
<br>
-----Original Message-----<br>
From: Gergely Nagy <<a href="mailto:algernon@balabit.com">algernon@balabit.com</a>> <br>
Sent: Wednesday, May 30, 2018 7:25 AM<br>
To: Amin, Jitesh CTR DISA JSP (US) <<a href="mailto:jitesh.amin.ctr@mail.mil">jitesh.amin.ctr@mail.mil</a>>; <a href="mailto:syslog-ng@lists.balabit.hu">syslog-ng@lists.balabit.hu</a><br>
Subject: [Non-DoD Source] Re: [syslog-ng] (U) Rotate syslog-ng log files<br>
<br>
All active links contained in this email were disabled. Please verify the identity of the sender, and confirm the authenticity of all links contained within the message prior to copying and pasting the address to a Web browser. <br>
<br>
<br>
<br>
<br>
----<br>
<br>
Hi!<br>
<br>
>>>>> "Amin" == Amin, Jitesh CTR DISA JSP (US) <<a href="mailto:jitesh.amin.ctr@mail.mil">jitesh.amin.ctr@mail.mil</a>> writes:<br>
<br>
Amin> What we are trying to do is rotate the syslog.log file once it<br>
Amin> reaches 500 MB (as well as looking into rotating file every 24<br>
Amin> hours)? Once the log file rotates, it creates a new file named<br>
Amin> syslog.log.0 and so on..<br>
<br>
syslog-ng does not support size-based rotation, you'll have to configure logrotate for that. See the packaging/debian/syslog-ng-<wbr>core.syslog-ng.logrotate[1] file for an example.<br>
<br>
[1]: Caution-<a href="https://github.com/balabit/syslog-ng/blob/master/packaging/debian/syslog-ng-core.syslog-ng.logrotate" rel="noreferrer" target="_blank">https://github.com/<wbr>balabit/syslog-ng/blob/master/<wbr>packaging/debian/syslog-ng-<wbr>core.syslog-ng.logrotate</a><br>
<br>
With logrotate, the most recent logfile syslog-ng writes to will always be syslog.log, and the rotated files will have different names - depending on the logrotate configuration you use.<br>
<br>
For time-based, daily rotation, you can use templates in the destination filename, such as:<br>
<br>
destination d_syslog {<br>
file("/var/log/syslog-${YEAR}-<wbr>${MONTH}-${DAY}.log");<br>
};<br>
<br>
Hope this helps!<br>
<br>
-- <br>
|8]<br>
<br>
<br>______________________________<wbr>______________________________<wbr>__________________<br>
Member info: <a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" rel="noreferrer" target="_blank">https://lists.balabit.hu/<wbr>mailman/listinfo/syslog-ng</a><br>
Documentation: <a href="http://www.balabit.com/support/documentation/?product=syslog-ng" rel="noreferrer" target="_blank">http://www.balabit.com/<wbr>support/documentation/?<wbr>product=syslog-ng</a><br>
FAQ: <a href="http://www.balabit.com/wiki/syslog-ng-faq" rel="noreferrer" target="_blank">http://www.balabit.com/wiki/<wbr>syslog-ng-faq</a><br>
<br>
<br></blockquote></div></div>