[syslog-ng] How to syslog-ng execute shell script

Attila Szakacs (aszakacs) Attila.Szakacs at oneidentity.com
Wed Dec 4 12:40:29 UTC 2019


I believe you are looking for a logrotate functionality. Please correct me if I am wrong.

There was a question in 2012 about it, let me give you a link to the answer:
https://lists.balabit.hu/pipermail/syslog-ng/2012-April/018683.html
Another thread about logrotate: https://github.com/syslog-ng/syslog-ng/pull/2798#issuecomment-553398341

You can add "compress" to the logrotate script, to run gzip on it.

Although the logrotate config above is based on the size of the file, is that suitable for you?

Regards,
Attila
________________________________
From: syslog-ng <syslog-ng-bounces at lists.balabit.hu> on behalf of William Luiz Ribeiro Vasconcelos Da Silva <wsilva_ericsson at timbrasil.com.br>
Sent: Wednesday, December 4, 2019 1:06 PM
To: syslog-ng at lists.balabit.hu <syslog-ng at lists.balabit.hu>
Subject: Re: [syslog-ng] How to syslog-ng execute shell script

CAUTION: This email originated from outside of the organization. Do not follow guidance, click links, or open attachments unless you recognize the sender and know the content is safe.

Attila,

My goal is after the file generation by syslog-ng. Call a script to concatenate files in 1000 lines and after running gzip.
Because the system that will collect these files expects the files to always be "zipped" and suffixed with .gzip

Regards,
William
________________________________
De: syslog-ng <syslog-ng-bounces at lists.balabit.hu> em nome de Attila Szakacs (aszakacs) <Attila.Szakacs at oneidentity.com>
Enviado: quarta-feira, 4 de dezembro de 2019 06:24
Para: syslog-ng at lists.balabit.hu <syslog-ng at lists.balabit.hu>
Assunto: Re: [syslog-ng] How to syslog-ng execute shell script

Hi William,

Yes it is possible:
program source: https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.24/administration-guide/23#TOPIC-1297952<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.syslog-ng.com%2Ftechnical-documents%2Fdoc%2Fsyslog-ng-open-source-edition%2F3.24%2Fadministration-guide%2F23%23TOPIC-1297952&data=02%7C01%7Cattila.szakacs%40oneidentity.com%7Cb1aadada26af41352efd08d778b2682d%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637110580032260110&sdata=nMqPimY2F0EK0RzTohtNOfyFIqKqVpubg9Hf4c2wZlg%3D&reserved=0>
program destination: https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.24/administration-guide/43#TOPIC-1298032<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.syslog-ng.com%2Ftechnical-documents%2Fdoc%2Fsyslog-ng-open-source-edition%2F3.24%2Fadministration-guide%2F43%23TOPIC-1298032&data=02%7C01%7Cattila.szakacs%40oneidentity.com%7Cb1aadada26af41352efd08d778b2682d%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637110580032270109&sdata=b90Xd8lyc%2BwbDwl6qf0N9pQONXbSRocbDnVXOGGFqds%3D&reserved=0>
hook-commands (for all sources and drivers with a few exceptions): https://www.syslog-ng.com/technical-documents/doc/syslog-ng-open-source-edition/3.24/administration-guide/hook-commands<https://nam05.safelinks.protection.outlook.com/?url=https%3A%2F%2Fwww.syslog-ng.com%2Ftechnical-documents%2Fdoc%2Fsyslog-ng-open-source-edition%2F3.24%2Fadministration-guide%2Fhook-commands&data=02%7C01%7Cattila.szakacs%40oneidentity.com%7Cb1aadada26af41352efd08d778b2682d%7C91c369b51c9e439c989c1867ec606603%7C0%7C0%7C637110580032280100&sdata=%2FcDSd%2BOFLYFfM%2BwzWz%2FY2u2AxSJamx2GHi4jsuIlte0%3D&reserved=0>

Is one of these actions suitable for you? What is the exact use case, when are you intending to run the script?

Regards,
Attila
________________________________
From: syslog-ng <syslog-ng-bounces at lists.balabit.hu> on behalf of William Luiz Ribeiro Vasconcelos Da Silva <wsilva_ericsson at timbrasil.com.br>
Sent: Tuesday, December 3, 2019 9:17 PM
To: syslog-ng at lists.balabit.hu <syslog-ng at lists.balabit.hu>
Subject: [syslog-ng] How to syslog-ng execute shell script

CAUTION: This email originated from outside of the organization. Do not follow guidance, click links, or open attachments unless you recognize the sender and know the content is safe.

Hello People,

How to configure the syslog-ng.conf file, to call a shell script, for example to do zip file.

It is possible to do this?

Tks,
William Luiz

Esta mensagem, incluindo seus anexos, pode conter informações privilegiadas e/ou de caráter confidencial, não podendo ser retransmitida sem autorização do remetente. Se você não é o destinatário ou pessoa autorizada para recebê-la, informamos que o seu uso, divulgação, cópia ou arquivamento são proibidos. Portanto, se você recebeu esta mensagem por engano, por favor nos informe respondendo imediatamente a este e-mail e delete o seu conteúdo.

This message, including its attachments, may contain privileged or confidential information, and it must not be fowarded without the express authorization of the sender. If you are not the intended recipient, we hereby inform you that the use, disclosure, copy or filing are forbidden. So, if you received this message as a mistake, please inform us by answering this e-mail and deleting its contents

Questo messaggio, inclusi gli allegati, potrebbe contenere informazioni privilegiate e/o riservate, e non deve essere ritrasmesse senza l'autorizzazione del mittente. Se non siete il destinatario o la persona autorizzata a riceverlo, informiamo che il suo utilizzo, diffusione, copia o archiviazione sono proibite. Quindi, se avete ricevuto questo messaggio per errore, per cortesia ci informi rispondendo immediatamente a questa email e cancelli il suo contenuto
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.balabit.hu/pipermail/syslog-ng/attachments/20191204/77188f7a/attachment-0001.html>


More information about the syslog-ng mailing list