I have setup a few custom decoders earlier and have a fair idea how it works. We have created a log file with data similar to shown below
wzh-inventory Hostname: XXXXX IPV4: 0.0.0.0 Serial: VMware-42 04 Make: VMware, Inc. Model: VMware Virtual Platform OS: CentOS Linux release 7.9.2009 (Core) Kernel: 3.10.0-1160.76.1.el7.x86_64 Function: Production Product: PROD Type: APP CPU: 4 Memory: 7
For some weird reason, the log only shows in the kibana UI when i remove the custom decoder and stops working as soon as put the decoder code back in /var/ossec/etc/decoders/local_decoder.xml
The decoder and associated rule work fine in the logtest , i am out of ideas whats going on
Decoder:
<decoder name="infra_inventory">
<prematch>wzh-inventory</prematch>
<regex type="pcre2">^wzh-inventory Hostname: (\w+) IPV4: (\d+.\d+.\d+.\d+) Serial: (\s.*) Make: (\s.*) Model: (\s.*) OS: ((?s).*) Kernel: (?s).* Function: (?s).* Type: (\w+) CPU: (\d+) Memory: (\d+)</regex>
<order>INF.INV_HOSTNAME,INF.INV_IPv4,INF.INV_SERIAL,INF.INV_MAKE,INF.INV_MODEL,INF.INV_OS_NAME,INF.INV_KERNEL,INF.INV_FUNCTIONALITY,INF.PRODUCT,INF.TYPE,INF.CPUCORE,INF.MEMORY</order>
</decoder>