Hi Bloom,
About your first question:
Unfortunately, there’s only one way to create dynamic and on-demand fields during the event processing stage: wrapping them into a JSON object. Maybe jq could help in this scenario, leading to the next output (example)
ossec: output: 'mycommand ':{ "result1":"A", "result2":"B", "result3":"C", "result4":"D",.....}After this, you should add a custom decoder that handles that output as a JSON object
<decoder name="ossec-mycommand-json"> <parent>ossec</parent> <type>ossec</type> <prematch offset="after_parent">^output: 'mycommand':</prematch> <plugin_decoder offset="after_prematch">JSON_Decoder</plugin_decoder> </decoder>Testing it with wazuh-logtest
[root@wazuh-server wazuh-user]# /var/ossec/bin/wazuh-logtest Starting wazuh-logtest v4.7.0 Type one log per line ossec: output: 'mycommand':{ "result1":"A", "result2":"B", "result3":"C", "result4":"D"} **Phase 1: Completed pre-decoding. full event: 'ossec: output: 'mycommand':{ "result1":"A", "result2":"B", "result3":"C", "result4":"D"}' **Phase 2: Completed decoding. name: 'ossec' parent: 'ossec' result1: 'A' result2: 'B' result3: 'C' result4: 'D' **Phase 3: Completed filtering (rules). id: '530' level: '0' description: 'Wazuh process monitoring rules.' groups: '['ossec', 'process_monitor']' firedtimes: '1' mail: 'False'After this, you just only need to create the rule to catch your events
About your second question
It’s difficult to make this work since we need heuristics to figure out what could or not be a password/sensitive information. On the other hand, let me check if there’s a way to limit full_log visualization by RBAC
Regards,
Nico