Hi! After searching why a log-message doesnt got the right destination path, I propably got a bit crossed up with the flag(final) statement, perhaps someone can enlight me :-) Following scenario (no valid syntax, only for description) filter(f_a) { match("something");}; destination(d_a) { file("/destination_a"); }: destination(d_b) { file("/destination_b"); }: destination(d_c) { file("/destination_c"); }: log { source(s_remote_default_syslog_udp); if filter(f_a) { destination(d_a); flag(final); } else { destination(d_b); flag(final); }; destination(d_c); }; What I expect is if filter->f_a hits the message is written in destination->d_a (what he do), then hits the final, and ends the log-statement What I discovered he also write destination->d_c Is that the expected behaviour? And if so, how to accomplish, that e.g. if the if or the else part hit, no destination -> d_c is written. Yeah I know, why the destination->d_c :-), correct I stumbled over this, normally after such a if/elif/else-Block I dunno have this destination->d_c line in my syslog-ng environments. Only a bit courious about it and seeking for an explanation. cheers Matthias ------------------------------------------------------------------------------------ METZLER Informationstechnologie Matthias Gruber IT-Infrastruktur & -Betrieb B. Metzler seel. Sohn & Co. Kommanditgesellschaft auf Aktien Untermainanlage 1 60329 Frankfurt am Main Telefon (0 69) 21 04 - 43 30 Telefax (0 69) 21 04 - 40 40 MGruber@metzler.com www.metzler.com Persönlich haftende Gesellschafter: Harald Illy, Friedrich von Metzler, Emmerich Müller, Gerhard Wiesheu Vorsitzender des Aufsichtsrats: Dr. Christoph Schücking Sitz der Gesellschaft: Frankfurt am Main, Handelsregister-Nr. HRB 27 515 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfänger sein, so bitten wir Sie höflich, dies unverzüglich dem Absender mitzuteilen und die Nachricht zu löschen. Es ist unzulässig, die Nachricht unbefugt weiterzuleiten oder zu kopieren. Da wir nicht die Echtheit oder Vollständigkeit der in dieser Nachricht enthaltenen Informationen garantieren oder zusichern können, sind die vorstehenden Ausführungen rechtlich nicht bindend. Eine Haftung hierfür wird ausgeschlossen. This message is confidential. If you are not the intended recipient, we kindly ask you to inform the sender and delete the information. Any unauthorised dissemination or copying hereof is prohibited. As we cannot guarantee or assure the genuineness or completeness of the information contained in this message, the statements set forth above are not legally binding. Accordingly we cannot accept any liability for their contents.
Hi, I'd say the flags(final)'s scope is the block {} it's in. But I'd also say flags(final) is not to be used from if/else statements. It was useful for channels and log paths, but why would you use it in if/else blocks ?
Thought of it, to "break" out of the log{} and not to check further if-blocks cheers Matthias ------------------------------------------------------------------------------------ METZLER Informationstechnologie Matthias Gruber IT-Infrastruktur & -Betrieb B. Metzler seel. Sohn & Co. Kommanditgesellschaft auf Aktien Untermainanlage 1 60329 Frankfurt am Main Telefon (0 69) 21 04 - 43 30 Telefax (0 69) 21 04 - 40 40 MGruber@metzler.com www.metzler.com Von: "Fabien Wernli" <wernli@in2p3.fr> An: "Syslog-ng users' and developers' mailing list" <syslog-ng@lists.balabit.hu> Datum: 08.02.2021 11:35 Betreff: Re: [syslog-ng] flags(final) - Question Gesendet von: "syslog-ng" <syslog-ng-bounces@lists.balabit.hu> Hi, I'd say the flags(final)'s scope is the block {} it's in. But I'd also say flags(final) is not to be used from if/else statements. It was useful for channels and log paths, but why would you use it in if/else blocks ? ______________________________________________________________________________ Member info: https://lists.balabit.hu/mailman/listinfo/syslog-ng Documentation: http://www.balabit.com/support/documentation/?product=syslog-ng FAQ: http://www.balabit.com/wiki/syslog-ng-faq Persönlich haftende Gesellschafter: Harald Illy, Friedrich von Metzler, Emmerich Müller, Gerhard Wiesheu Vorsitzender des Aufsichtsrats: Dr. Christoph Schücking Sitz der Gesellschaft: Frankfurt am Main, Handelsregister-Nr. HRB 27 515 Diese Nachricht ist vertraulich. Sollten Sie nicht der vorgesehene Empfänger sein, so bitten wir Sie höflich, dies unverzüglich dem Absender mitzuteilen und die Nachricht zu löschen. Es ist unzulässig, die Nachricht unbefugt weiterzuleiten oder zu kopieren. Da wir nicht die Echtheit oder Vollständigkeit der in dieser Nachricht enthaltenen Informationen garantieren oder zusichern können, sind die vorstehenden Ausführungen rechtlich nicht bindend. Eine Haftung hierfür wird ausgeschlossen. This message is confidential. If you are not the intended recipient, we kindly ask you to inform the sender and delete the information. Any unauthorised dissemination or copying hereof is prohibited. As we cannot guarantee or assure the genuineness or completeness of the information contained in this message, the statements set forth above are not legally binding. Accordingly we cannot accept any liability for their contents.
participants (2)
-
Fabien Wernli
-
Matthias Gruber