[syslog-ng] Remove Part of message

Attila Szakacs (aszakacs) Attila.Szakacs at oneidentity.com
Thu Oct 3 06:09:52 UTC 2019


Hi William,

You can use rewrite rules to achieve this.
For example:
source s_udp {
    udp(port(9999));
};

rewrite r_remove_hex {
    subst(" 0x[0-9a-z]*$" "" value(MESSAGE));
};

destination d_local {
    file("/tmp/test.log");
};

log {
    source(s_udp);
    rewrite(r_remove_hex);
    destination(d_local);
};


$ cat /tmp/test.log
Oct  3 08:05:22 localhost RELEASE: 100.80.93.85 -> 189.40.107.74:55200-55215

Best 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, October 2, 2019 7:24 PM
To: syslog-ng at lists.balabit.hu <syslog-ng at lists.balabit.hu>
Subject: [syslog-ng] Remove Part of message

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.

Good afternoon every one!,


This is a example of message collected using syslo-ng:

RELEASE: 100.80.93.85 -> 189.40.107.74:55200-55215 0x5d8f3e5a

And I need remove from message this part: 0x5d8f3e5a. My question is, how I can remove it ?

Because the message should be send to destination without this part.


Thanks for your help!

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/20191003/5cad752f/attachment-0001.html>


More information about the syslog-ng mailing list