Hi Juan,
The log sample that you are sending is decoded by Wazuh
May 25 00:52:59 10.1.128.16 03362 auth: User 'manager' login from 10.1.2.70
**Phase 1: Completed pre-decoding.
full event: 'May 25 00:52:59 10.1.128.16 03362 auth: User 'manager' login from 10.1.2.70'
timestamp: 'May 25 00:52:59'
hostname: '10.1.128.16'
program_name: '(null)'
log: '03362 auth: User 'manager' login from 10.1.2.70'
**Phase 2: Completed decoding.
decoder: 'squid-accesslog'
**Phase 3: Completed filtering (rules).
Rule id: '35000'
Level: '0'
Description: 'Squid messages grouped.'
But in this specific case is decoded by Squid messages, really the Squid decoder is very “Open”:
<decoder name="squid-accesslog">
<type>squid</type>
<prematch>^\d+ \S+ </prematch>
<regex>^\d+ (\S+) (\w+)/(\d+) \d+ \w+ (\S+) </regex>
<order>srcip,action,id,url</order>
</decoder>
My recommendation is to create a custom decoder more explicit for your log, and not for the archives.log.
Something like the following:
<decoder name="hp">
<prematch>^ \w\w\w \d\d \d\d:\d\d:\d\d</prematch>
</decoder>
And the outputs is something like:
May 25 00:52:59 10.1.128.16 03362 auth: User 'manager' login from 10.1.2.70
**Phase 1: Completed pre-decoding.
full event: ' May 25 00:52:59 10.1.128.16 03362 auth: User 'manager' login from 10.1.2.70'
timestamp: '(null)'
hostname: 'wazuh-manager'
program_name: '(null)'
log: ' May 25 00:52:59 10.1.128.16 03362 auth: User 'manager' login from 10.1.2.70'
**Phase 2: Completed decoding.
decoder: 'hp'
Please note that your log always has an space before the Month ’ May 25 00:52:59 10.1.128.16 03362 auth: User ‘manager’ login from 10.1.2.70’, this is why the decoder has also a space between ^ and \w\w\w.
Also if you want to export some fields we should have more information about the log format, for this specific log (User login) somthing like this:
<decoder name="hp">
<prematch>^ \w\w\w \d\d \d\d:\d\d:\d\d</prematch>
<regex offset="after_prematch">User '(\S+)' \.+ from (\d+.\d+.\d+.\d+)</regex>
<order>user,srcip</order>
</decoder>
May 25 00:52:59 10.1.128.16 03362 auth: User 'manager' login from 10.1.2.70
**Phase 1: Completed pre-decoding.
full event: ' May 25 00:52:59 10.1.128.16 03362 auth: User 'manager' login from 10.1.2.70'
timestamp: '(null)'
hostname: 'wazuh-manager'
program_name: '(null)'
log: ' May 25 00:52:59 10.1.128.16 03362 auth: User 'manager' login from 10.1.2.70'
**Phase 2: Completed decoding.
decoder: 'hp'
dstuser: 'manager'
srcip: '10.1.2.70'
I hope it helps.
--
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 post to this group, send email to wa...@googlegroups.com.
Visit this group at https://groups.google.com/group/wazuh.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/e3f670f5-83b2-4985-bab6-7906e10553a1%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.
To unsubscribe from this group and stop receiving emails from it, send an email to wazuh+unsubscribe@googlegroups.com.
To unsubscribe from this group and stop receiving emails from it, send an email to wazuh+un...@googlegroups.com.
To post to this group, send email to wa...@googlegroups.com.
Visit this group at https://groups.google.com/group/wazuh.
To view this discussion on the web visit https://groups.google.com/d/msgid/wazuh/f39de14e-f81f-4f3d-b14f-056fff8ccf71%40googlegroups.com.