The log mask of agent does not work on Linux #34106
-
|
I need to receive events from all nested logs in the <localfile>
<log_format>apache</log_format>
<location>/var/log/nginx/error.log</location>
</localfile>
<localfile>
<log_format>plain</log_format>
<location>/var/log/nginx/*plain.log</location>
</localfile>
<localfile>
<log_format>json</log_format>
<location>/var/log/nginx/*json.log</location>
</localfile>and more... /var/log/nginx/*json.log
/var/log/nginx/*_json.log
/var/log/nginx/*It didn't work out that way. Data and specs: wazuh version : "v4.14.1"
Version wazuh agent: Wazuh v4.14.1
OS on host with agent wazuh : Ubuntu 22.04.5 LTS |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
|
Based on the details you shared, you’re trying to monitor The key point is:
First, check the log format inside the log file that you are trying to monitor and configure the <localfile>
<location>/var/log/nginx/*.log</location>
<log_format>syslog</log_format>
</localfile>Then restart the Wazuh agent to apply the configuration: systemctl restart wazuh-agentAfter that, the agent will start monitoring the log files inside the Note that, to trigger alerts and show them on the dashboard based on the events from the monitored log files, there should be decoders and rules on the Wazuh manager. If the events match the default decoders and rules in Wazuh, then alerts will be shown on the dashboard. If not, you should create custom decoders and rules based on the log format. To check if the default decoders and rules match the events, you can run a log test. You can refer the following documentation for decoder and rule creation:
If you need further assistance, please let us know. Also, please share the following details:
|
Beta Was this translation helpful? Give feedback.
Based on the details you shared, you’re trying to monitor
.logfiles under/var/log/nginx/using localfile monitoring, and you’ve tried different values under<log_format>.The key point is:
<log_format>must match the actual format of the log lines inside the file.You can refer to the Wazuh documentation for supported
<log_format>values and examples.First, check the log format inside the log file that you are trying to monitor and configure the
<log_format>accordingly.For example, if the log format inside all the log files in the
/var/log/nginx/directory is syslog, then your configurati…