<div dir="ltr">C_ macros are much newer than 1.6, S_ and R_ probably work.</div><div class="gmail_extra"><br><div class="gmail_quote">On Thu, Jun 7, 2018 at 2:18 PM, Sandor Geller <span dir="ltr"><<a href="mailto:sandor.geller@ericsson.com" target="_blank">sandor.geller@ericsson.com</a>></span> wrote:<br><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div class="m_-888374457547434678moz-cite-prefix">Hello,<br>
      <br>
      Syslog-ng doesn't do any form of rotation - you're using macros in
      the destination filenames instead. Contents of macros like $YEAR
      get parsed from the timestamp of the incoming messages so as long
      as messages contain older timestamps syslog-ng will (re)open files
      reflecting these older timestamps and append logs there. There is
      no need to restart syslog-ng as not the restart changes where logs
      will get written but the metadata associated with the logs.<br>
      <br>
      IIRC the antique 1.6.8 version you're using also has support for
      other datetime macros (prefixed with C_ or R_) which reflect the
      'C'urrent or 'R'eception timestamp so you can alter the current
      behaviour - although I wouldn't recommend switching for example to
      $C_YEAR-$C_MONTH-$C_DAY as it could be confusing to see the last
      few logs of a given day written to another file than people would
      expect.<br>
      <br>
      Does this make sense or did I misunderstood your observation?<br>
      <br>
      Regards,<br>
      Sandor<div><div class="h5"><br>
      <br>
      On 06/07/2018 01:06 PM, Amin, Jitesh CTR DISA JSP (US) wrote:<br>
    </div></div></div>
    <blockquote type="cite"><div><div class="h5">
      
      
      
      
      <div class="m_-888374457547434678WordSection1">
        <p>CLASSIFICATION: UNCLASSIFIED<u></u><u></u></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Hello,<u></u><u></u></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">So
            the file rotates now successfully – but what I have noticed
            is that after the file rotates it collects data for first
            few minute or so and then it stops collecting data
            (basically the file size never grows and timestamp never
            changes to the most latest when I check the file).<u></u><u></u></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">I
            do see that syslog process/service is running. If I restart
            the service/process, it starts collecting data until the
            file rotation happens.<u></u><u></u></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Can
            you please let me know what would be causing this behavior?<u></u><u></u></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
        <div>
          <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Thanks<u></u><u></u></span></p>
          <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Jitesh
              Amin<u></u><u></u></span></p>
        </div>
        <p>CLASSIFICATION: UNCLASSIFIED<u></u><u></u></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
        <div>
          <div style="border:none;border-top:solid #e1e1e1 1.0pt;padding:3.0pt 0in 0in 0in">
            <p class="MsoNormal"><a name="m_-888374457547434678______replyseparator"></a><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
                Amin, Jitesh CTR DISA JSP (US) <br>
                <b>Sent:</b> Tuesday, June 5, 2018 9:59 AM<br>
                <b>To:</b> Syslog-ng users' and developers' mailing list
                <a class="m_-888374457547434678moz-txt-link-rfc2396E" href="mailto:syslog-ng@lists.balabit.hu" target="_blank"><syslog-ng@lists.balabit.hu></a><br>
                <b>Subject:</b> RE: (U) [syslog-ng] [Non-DoD Source] Re:
                Rotate syslog-ng log files<u></u><u></u></span></p>
          </div>
        </div>
        <p class="MsoNormal"><u></u> <u></u></p>
        <p>CLASSIFICATION: UNCLASSIFIED<u></u><u></u></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">OK
            skipping the {} made it work and I now see a syslog file
            with timestamp (year-month-day). Does this mean it should
            rotate to new log file name (tomorrows timestamp) at
            midnight tonight? OR I need to add syntax so it rolls
            everyday with new timestamp. Just wanted to confirm.<u></u><u></u></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Thanks<u></u><u></u></span></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d">Jitesh
            Amin<u></u><u></u></span></p>
        <p>CLASSIFICATION: UNCLASSIFIED<u></u><u></u></p>
        <p class="MsoNormal"><span style="font-size:11.0pt;font-family:"Calibri",sans-serif;color:#1f497d"><u></u> <u></u></span></p>
        <p class="MsoNormal"><b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">From:</span></b><span style="font-size:11.0pt;font-family:"Calibri",sans-serif">
            syslog-ng <a class="m_-888374457547434678moz-txt-link-rfc2396E" href="mailto:syslog-ng-bounces@lists.balabit.hu" target="_blank"><syslog-ng-bounces@lists.<wbr>balabit.hu></a> <b>On
              Behalf Of </b>Scheidler, Balázs<br>
            <b>Sent:</b> Thursday, May 31, 2018 5:48 AM<br>
            <b>To:</b> Syslog-ng users' and developers' mailing list
            <a class="m_-888374457547434678moz-txt-link-rfc2396E" href="mailto:syslog-ng@lists.balabit.hu" target="_blank"><syslog-ng@lists.balabit.hu></a><br>
            <b>Subject:</b> Re: [syslog-ng] (U) [Non-DoD Source] Re:
            Rotate syslog-ng log files<u></u><u></u></span></p>
        <p class="MsoNormal"><u></u> <u></u></p>
        <p class="MsoNormal" style="margin-bottom:12.0pt">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. <u></u><u></u></p>
        <div class="MsoNormal" style="text-align:center" align="center">
          <hr width="100%" size="2" align="center"></div>
        <p class="MsoNormal" style="margin-bottom:12.0pt"><u></u> <u></u></p>
        <div>
          <p class="MsoNormal">I mean syslog-ng 1.6.8<u></u><u></u></p>
        </div>
        <div>
          <p class="MsoNormal"><u></u> <u></u></p>
          <div>
            <p class="MsoNormal">On May 30, 2018 22:54, "Balazs
              Scheidler"
              <<a class="m_-888374457547434678moz-txt-link-abbreviated" href="mailto:bazsi77@gmail.com" target="_blank">bazsi77@gmail.com</a> <a class="m_-888374457547434678moz-txt-link-rfc2396E" href="mailto:%C2%A0Caution-mailto:bazsi77@gmail.com" target="_blank">< Caution-<wbr>mailto:bazsi77@gmail.com ></a> >
              wrote:<u></u><u></u></p>
            <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
              <div>
                <p class="MsoNormal">syslog-ng does have template
                  support, it just doesnt support braces, which came
                  later.<u></u><u></u></p>
                <div>
                  <p class="MsoNormal"><u></u> <u></u></p>
                </div>
                <div>
                  <p class="MsoNormal">Just write $YEAR instead of
                    ${YEAR}<u></u><u></u></p>
                </div>
              </div>
              <div>
                <p class="MsoNormal"><u></u> <u></u></p>
                <div>
                  <p class="MsoNormal">On May 30, 2018 09:41, "Gergely
                    Nagy"
<<a class="m_-888374457547434678moz-txt-link-abbreviated" href="mailto:algernon@balabit.com" target="_blank">algernon@balabit.com</a> <a class="m_-888374457547434678moz-txt-link-rfc2396E" href="mailto:%C2%A0Caution-mailto:algernon@balabit.com" target="_blank">< <wbr>Caution-mailto:algernon@<wbr>balabit.com ></a> >
                    wrote:<u></u><u></u></p>
                  <blockquote style="border:none;border-left:solid #cccccc 1.0pt;padding:0in 0in 0in 6.0pt;margin-left:4.8pt;margin-top:5.0pt;margin-right:0in;margin-bottom:5.0pt">
                    <p class="MsoNormal" style="margin-bottom:12.0pt">>>>>>
                      "Amin" == Amin, Jitesh CTR DISA JSP (US)
<<a class="m_-888374457547434678moz-txt-link-abbreviated" href="mailto:jitesh.amin.ctr@mail.mil" target="_blank">jitesh.amin.ctr@mail.mil</a> <a class="m_-888374457547434678moz-txt-link-rfc2396E" href="mailto:%C2%A0Caution-mailto:jitesh.amin.ctr@mail.mil" target="_blank">< <wbr>Caution-mailto:jitesh.amin.<wbr>ctr@mail.mil ></a> >
                      writes:<br>
                      <br>
                          Amin> Let me ask this, with the following
                      config = destination<br>
                          Amin> syslog {
                      file("/var/log/syslog-${YEAR}-<wbr>${MONTH}-${DAY}.log");<br>
                          Amin> };<br>
                      <br>
                          Amin> It created new file and started
                      writing to it (versus creating<br>
                          Amin> new syslog.log). Question, if we plan
                      to accept this for now,<br>
                          Amin> with above config, would it create a
                      new file ever day with<br>
                          Amin> following file names or no it would
                      not work with v1.6.8<br>
                      <br>
                      With syslog-ng 1.6.8, it would not create a new
                      file every day, and<br>
                      would continue writing to
                      syslog-{YEAR}-{MONTH}-{DAY}.<wbr>log. With newer<br>
                      versions, it would create files like
                      `syslog-2018-05-30.log`. No `.0`,<br>
                      `.1` or the like would be appended. That's a
                      convention of logrotate.<br>
                      With syslog-ng, you get filenames that match the
                      template, they will<br>
                      have nothing appended or prepended that is not in
                      the filename template.<br>
                      <br>
                      -- <br>
                      |8]<br>
______________________________<wbr>______________________________<wbr>__________________<br>
                      Member info:
Caution-<a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" target="_blank">https://lists.balabit.<wbr>hu/mailman/listinfo/syslog-ng</a> <wbr>< Caution-<a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" target="_blank">https://lists.<wbr>balabit.hu/mailman/listinfo/<wbr>syslog-ng</a> > <br>
                      Documentation:
Caution-<a href="http://www.balabit.com/support/documentation/?product=syslog-ng" target="_blank">http://www.balabit.<wbr>com/support/documentation/?<wbr>product=syslog-ng</a> < Caution-<a href="http://www.balabit.com/support/documentation/?product=syslog-ng" target="_blank">ht<wbr>tp://www.balabit.com/support/<wbr>documentation/?product=syslog-<wbr>ng</a> > <br>
                      FAQ:
Caution-<a href="http://www.balabit.com/wiki/syslog-ng-faq" target="_blank">http://www.balabit.<wbr>com/wiki/syslog-ng-faq</a> < <wbr>Caution-<a href="http://www.balabit.com/wiki/syslog-ng-faq" target="_blank">http://www.balabit.<wbr>com/wiki/syslog-ng-faq</a> > <u></u><u></u></p>
                  </blockquote>
                </div>
              </div>
              <p class="MsoNormal" style="margin-bottom:12.0pt"><br>
______________________________<wbr>______________________________<wbr>__________________<br>
                Member info:
Caution-<a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" target="_blank">https://lists.balabit.<wbr>hu/mailman/listinfo/syslog-ng</a> <wbr>< Caution-<a href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" target="_blank">https://lists.<wbr>balabit.hu/mailman/listinfo/<wbr>syslog-ng</a> > <br>
                Documentation:
Caution-<a href="http://www.balabit.com/support/documentation/?product=syslog-ng" target="_blank">http://www.balabit.<wbr>com/support/documentation/?<wbr>product=syslog-ng</a> < Caution-<a href="http://www.balabit.com/support/documentation/?product=syslog-ng" target="_blank">ht<wbr>tp://www.balabit.com/support/<wbr>documentation/?product=syslog-<wbr>ng</a> > <br>
                FAQ:
Caution-<a href="http://www.balabit.com/wiki/syslog-ng-faq" target="_blank">http://www.balabit.<wbr>com/wiki/syslog-ng-faq</a> < <wbr>Caution-<a href="http://www.balabit.com/wiki/syslog-ng-faq" target="_blank">http://www.balabit.<wbr>com/wiki/syslog-ng-faq</a> > <u></u><u></u></p>
            </blockquote>
          </div>
        </div>
      </div>
      <br>
      <fieldset class="m_-888374457547434678mimeAttachmentHeader"></fieldset>
      <br>
      </div></div><span class=""><pre>______________________________<wbr>______________________________<wbr>__________________
Member info: <a class="m_-888374457547434678moz-txt-link-freetext" href="https://lists.balabit.hu/mailman/listinfo/syslog-ng" target="_blank">https://lists.balabit.hu/<wbr>mailman/listinfo/syslog-ng</a>
Documentation: <a class="m_-888374457547434678moz-txt-link-freetext" href="http://www.balabit.com/support/documentation/?product=syslog-ng" target="_blank">http://www.balabit.com/<wbr>support/documentation/?<wbr>product=syslog-ng</a>
FAQ: <a class="m_-888374457547434678moz-txt-link-freetext" href="http://www.balabit.com/wiki/syslog-ng-faq" target="_blank">http://www.balabit.com/wiki/<wbr>syslog-ng-faq</a>

</pre>
    </span></blockquote>
    <p><br>
    </p>
  </div>

<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><br></div>