On 28 July 2022 13.38.17 UTC, "João Silva" <joaopfmlist@lipc.fis.uc.pt> wrote:
Thanks a lot for this thread.
I was starting to plan a system where multiples processes can write to a file and completely forgot that syslog is designed to do that.
It is a perfect solution, I only had to configure a local facility to receive the data and add 3 lines of code to the program (including the import).
On 28/07/2022 12:01, Paul Kudla (SCOM.CA Internet Services Inc.) wrote:
Hi - I use this python script to capture a socket (ie the log file) and then send it to syslog, i use this for all the systems that do not really support syslogging (apache etc)
basic useage
/usr/bin/nohup /programs/common/capture -s /usr/local/apache2/logs/httpd-access.log -l httpd -d 10.228.0.6:514 -p httpd & > /dev/null
i typically run this at startup in rc.local
<snip/>
On 7/28/2022 6:17 AM, dovecot-bounces@dovecot.org wrote:
Hi, I'm searching for a possibility to have the rawlog feature in lua, which would be much easier for processing. Currently Dovecot, when activating rawlog for a user, writes everything to disk (which creates I/O), and I have to somehow read it from there. That's a bit complicated, because I have to get notified via inotify or similar when there are new files created, and then I have to start a "tail" or "epoll" mechanism on the files to get the contents in more or less real time (IMAP sessions can be multiple hours or days). It would be much easier to hook to the "raw request and response events" inside Dovecot and have the rawlog-data in a lua script, where I can prepare it and send it to another maschine for monitoring/collection/analysis/statistics or similar, for example via HTTP. Having the rawlog data available in lua would make things a lot easier. Is there any possibility at the moment to create a lua script and "hook" to those "request and response events"? If not, would it be possible to add that feature in the future? Kind regards Michael
If you are only interested in IMAP commands you can use event exporter to send individual commands preparsed in json format to HTTP endpoint.
Aki