Hello M. Ali,
To send Apache logs to Wazuh manager you can use Log Data Collection. You can configure it using our documentation. An example of configuration could be the following:
<localfile>
<log_format>syslog</log_format>
<location>/var/log/apache.log</location>
</localfile>
We have rules and decoders to Apache logs, you can find it in ruleset/rules/0250-apache_rules.xml and ruleset/decoders/0025-apache_decoders.xml files.
Also, you can create your own rules and decoders. Follow the link for more information: Custom rules and decoders
If you need help with some rule or decoder you should send us the log you want to generate the alert.
I hope it helps you. If you have further questions let us know.
Best regards,
Eva
<localfile>
<log_format>syslog</log_format>
<location>c:\wamp\www\logs\%y_%m_user_access.log</location>
</localfile>
now I am confused that where this code need to past in agent OSSEC.config file or in WAZUH manager ossec.config file ?
Hello M. Ali,
This configuration must be added in the machine you have the Apache server.
If it’s a manager add the configuration in the manager’s ossec.conf.
If it’s an agent you can add it in ossec.conf found in the agent or in agent.conf.
The agent.conf file is useful to configure the agents remotely, you can read more about it following the link.
Best regards,
Eva

<agent_config os="windows"> <localfile> <log_format>syslog</log_format> <location>C:\wamp\logs\*.log</location> </localfile> </agent_config>
2020/10/09 02:41:59 ossec-agent: INFO: (1957): New file that matches the 'C:\wamp\logs\*.log' pattern: 'C:\wamp\logs\access.log'. 2020/10/09 02:41:59 ossec-agent: INFO: (1957): New file that matches the 'C:\wamp\logs\*.log' pattern: 'C:\wamp\logs\apache_error.log'. 2020/10/09 02:41:59 ossec-agent: INFO: (1957): New file that matches the 'C:\wamp\logs\*.log' pattern: 'C:\wamp\logs\mariadb.log'. 2020/10/09 02:41:59 ossec-agent: INFO: (1957): New file that matches the 'C:\wamp\logs\*.log' pattern: 'C:\wamp\logs\mysql.log'. 2020/10/09 02:41:59 ossec-agent: INFO: (1957): New file that matches the 'C:\wamp\logs\*.log' pattern: 'C:\wamp\logs\php_error.log'. 2020/10/09 02:41:59 ossec-agent: INFO: (1957): New file that matches the 'C:\wamp\logs\*.log' pattern: 'C:\wamp\logs\wamptrace.log'.
<ossec_config> <global> <logall>yes</logall>
$ sudo service wazuh-manager restart
2020 Oct 09 11:43:32 (windows) any->\wamp\logs\access.log ::1 - - [09/Oct/2020:02:43:31 -0700] "GET / HTTP/1.1" 200 6019
$ echo '::1 - - [09/Oct/2020:02:43:31 -0700] "GET / HTTP/1.1" 200 6019' | sudo /var/ossec/bin/ossec-logtest 2020/10/09 11:44:14 ossec-testrule: INFO: Started (pid: 11199). ossec-testrule: Type one log per line. **Phase 1: Completed pre-decoding. full event: '::1 - - [09/Oct/2020:02:43:31 -0700] "GET / HTTP/1.1" 200 6019' timestamp: '(null)' hostname: 'focal' program_name: '(null)' log: '::1 - - [09/Oct/2020:02:43:31 -0700] "GET / HTTP/1.1" 200 6019' **Phase 2: Completed decoding. decoder: 'web-accesslog' srcip: '::1' protocol: 'GET' url: '/' id: '200' **Phase 3: Completed filtering (rules). Rule id: '31108' Level: '0' Description: 'Ignored URLs (simple queries).'
<group name="web,accesslog,"> <rule id="31108" level="3" overwrite="yes"> <if_sid>31100</if_sid> <id>^2|^3</id> <compiled_rule>is_simple_http_request</compiled_rule> <description>Simple query.</description> </rule> </group>
$ echo '::1 - - [09/Oct/2020:02:43:31 -0700] "GET / HTTP/1.1" 200 6019' | sudo /var/ossec/bin/ossec-logtest (...) **Phase 3: Completed filtering (rules). Rule id: '31108' Level: '3' Description: 'Simple query.' **Alert to be generated.
** Alert 1602237150.333040: - web,accesslog, 2020 Oct 09 11:52:30 (windows) any->\wamp\logs\access.log Rule: 31108 (level 3) -> 'Simple query.' Src IP: ::1 ::1 - - [09/Oct/2020:02:52:29 -0700] "GET / HTTP/1.1" 200 6019
--
You received this message because you are subscribed to the Google Groups "Wazuh mailing list" group.
To unsubscribe from this group and stop receiving emails from it, send an email to wazuh+un...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/3740614b-8feb-462f-b268-756dcfa0da0en%40googlegroups.com.