Hello Santiago,
The problem is that the sudo is configured to save logs on a external file (/var/log/sudo.log) and when sudo has the logfile paramenter configured in sudoers, the logged event does not have the hostname and program name fields so the line is different from what it would be in the /var/log/secure.
In the /var/log/secure I will have the event logged as below:
Oct 4 09:26:55 hostname sudo: usuario : TTY=pts/0 ; PWD=/home/usuario ; USER=root ; COMMAND=/bin/su -
Which the wazuh-agent can read without problem.
But on the external file configured for logging sudo events, the same event will be logged as follow:
Oct 4 09:26:55 : usuario : TTY=pts/0 ; PWD=/home/usuario ; USER=root ; COMMAND=/bin/su -
The difference is that I don't have the hostname nor the program name field and this way the wazuh-agent can't decode the file, I already managed to make sudo save the full log on a single line, but it still isn't getting decoded.
How can I solve this problem? I think that I will need to create a custom decoder, but how? The documentation that I found till now does not have examples on how to do that, since I will have to match by the file name, not a field.
Is it possible?