Hi Ranjit
I hope you are doing fine!
I find a way to process your example log:
{"timestamp":"2021-12-21T14:23:23.904+0000","agent":{"id":"003","name":"Plugins-ADFS","ip":"*****"},"manager":{"name":"*****"},"id":"1640096603.336656","full_log":"{\"win\":{\"system\":{\"providerName\":\"Microsoft-Windows-TaskScheduler\",\"providerGuid\":\"{DE7B24EA-73C8-4A09-985D-5BDADCFA9017}\",\"eventID\":\"108\",\"version\":\"0\",\"level\":\"4\",\"task\":\"108\",\"opcode\":\"0\",\"keywords\":\"0x8000000000000000\",\"systemTime\":\"2021-12-21T14:23:20.012913000Z\",\"eventRecordID\":\"2486746518\",\"processID\":\"808\",\"threadID\":\"4724\",\"channel\":\"Microsoft-Windows-TaskScheduler/Operational\",\"computer\":\"Plugins-ADFS.logpoint.local\",\"severityValue\":\"INFORMATION\",\"message\":\"\\\"Task Scheduler launched \\\"{00000000-0000-0000-0000-000000000000}\\\" instance of task \\\"\\\\Event Viewer Tasks\\\\Microsoft-Windows-TaskScheduler_Operational\\\" according to an event trigger.\\\"\"},\"eventdata\":{\"taskName\":\"\\\\\\\\Event Viewer Tasks\\\\\\\\Microsoft-Windows-TaskScheduler_Operational\",\"instanceId\":\"{00000000-0000-0000-0000-000000000000}\"}}}","decoder":{"name":"windows_eventchannel"},"data":{"win":{"system":{"providerName":"Microsoft-Windows-TaskScheduler","providerGuid":"{DE7B24EA-73C8-4A09-985D-5BDADCFA9017}","eventID":"108","version":"0","level":"4","task":"108","opcode":"0","keywords":"0x8000000000000000","systemTime":"2021-12-21T14:23:20.012913000Z","eventRecordID":"2486746518","processID":"808","threadID":"4724","channel":"Microsoft-Windows-TaskScheduler/Operational","computer":"Plugins-ADFS.logpoint.local","severityValue":"INFORMATION","message":"\"Task Scheduler launched \"{00000000-0000-0000-0000-000000000000}\" instance of task \"\\Event Viewer Tasks\\Microsoft-Windows-TaskScheduler_Operational\" according to an event trigger.\""},"eventdata":{"taskName":"\\\\Event Viewer Tasks\\\\Microsoft-Windows-TaskScheduler_Operational","instanceId":"{00000000-0000-0000-0000-000000000000}"}}},"location":"EventChannel"}
To follow all the preocess into my environment, I created a test.txt file into an windows agent box, and added following config:
<localfile>
<location>C:\Users\test.txt</location>
<log_format>syslog</log_format>
</localfile>
Then I updated the custom rule as following:
<rule id="111111" level="4">
<decoded_as>json</decoded_as>
<description>Allow all logs</description>
<options>no_full_log</options>
</rule>
And to collect same event as you have, open
test.txt file into agent. Paste the example log into and save file changes, that will make agent collect that event and send it to the manager.
As you can see manager proccess it with expected rule id.
Into
/var/ossec/logs/archives/archives.json it's looks like:
{"timestamp":"2021-12-29T12:36:30.437-0300","rule":{"level":4,"description":"Allow all logs","id":"
111111","firedtimes":2,"mail":false,"groups":["local","syslog","sshd"]},"agent":{"id":"001","name":"DESKTOP-U8OH
D3A","ip":"192.168.100.72"},"manager":{"name":"chb-VBox"},"id":"1640792190.3093486","full_log":"{\"timestamp\":\"2021-12-21T14:23:23.904+0000\",\"agent\":{\"id\":\"003\",\"name\":\"Plugins-ADFS\",\"ip\":\"*****\
"},\"manager\":{\"name\":\"*****\"},\"id\":\"1640096603.336656\",\"full_log\":\"{\\\"win\\\":{\\\"system\\\":{\\\"providerName\\\":\\\"Microsoft-Windows-TaskScheduler\\\",\\\"providerGuid\\\":\\\"{DE7B24EA-73C8-
4A09-985D-5BDADCFA9017}\\\",\\\"eventID\\\":\\\"108\\\",\\\"version\\\":\\\"0\\\",\\\"level\\\":\\\"4\\\",\\\"task\\\":\\\"108\\\",\\\"opcode\\\":\\\"0\\\",\\\"keywords\\\":\\\"0x8000000000000000\\\",\\\"systemT
ime\\\":\\\"2021-12-21T14:23:20.012913000Z\\\",\\\"eventRecordID\\\":\\\"
2486746518\\\",\\\"processID\\\":\\\"808\\\",\\\"threadID\\\":\\\"4724\\\",\\\"channel\\\":\\\"Microsoft-Windows-TaskScheduler/Operational
\\\",\\\"computer\\\":\\\"Plugins-ADFS.logpoint.local\\\",\\\"severityValue\\\":\\\"INFORMATION\\\",\\\"message\\\":\\\"\\\\\\\"Task Scheduler launched \\\\\\\"{00000000-0000-0000-0000-000000000000}\\\\\\\" ins
tance of task \\\\\\\"\\\\\\\\Event Viewer Tasks\\\\\\\\Microsoft-Windows-TaskScheduler_Operational\\\\\\\" according to an event trigger.\\\\\\\"\\\"},\\\"eventdata\\\":{\\\"taskName\\\":\\\"\\\\\\\\\\\\\\\\Ev
ent Viewer Tasks\\\\\\\\\\\\\\\\Microsoft-Windows-TaskScheduler_Operational\\\",\\\"instanceId\\\":\\\"{00000000-0000-0000-0000-000000000000}\\\"}}}\",\"decoder\":{\"name\":\"windows_eventchannel\"},\"data\":{\"
win\":{\"system\":{\"providerName\":\"Microsoft-Windows-TaskScheduler\",\"providerGuid\":\"{DE7B24EA-73C8-4A09-985D-5BDADCFA9017}\",\"eventID\":\"108\",\"version\":\"0\",\"level\":\"4\",\"task\":\"108\",\"opcode
\":\"0\",\"keywords\":\"0x8000000000000000\",\"systemTime\":\"2021-12-21T14:23:20.012913000Z\",\"eventRecordID\":\"
2486746518\",\"processID\":\"808\",\"threadID\":\"4724\",\"channel\":\"Microsoft-Windows-TaskSch
eduler/Operational\",\"computer\":\"Plugins-ADFS.logpoint.local\",\"severityValue\":\"INFORMATION\",\"message\":\"\\\"Task Scheduler launched \\\"{00000000-0000-0000-0000-000000000000}\\\" instance of task \\\"
\\\\Event Viewer Tasks\\\\Microsoft-Windows-TaskScheduler_Operational\\\" according to an event trigger.\\\"\"},\"eventdata\":{\"taskName\":\"\\\\\\\\Event Viewer Tasks\\\\\\\\Microsoft-Windows-TaskScheduler_Op
erational\",\"instanceId\":\"{00000000-0000-0000-0000-000000000000}\"}}},\"location\":\"EventChannel\"}","decoder":{"name":"json"},"data":{"id":"1640096603.336656","timestamp":"2021-12-21T14:23:23.904+0000","age
nt":{"id":"003","name":"Plugins-ADFS","ip":"*****"},"manager":{"name":"*****"},"full_log":"{\"win\":{\"system\":{\"providerName\":\"Microsoft-Windows-TaskScheduler\",\"providerGuid\":\"{DE7B24EA-73C8-4A09-985D-5
BDADCFA9017}\",\"eventID\":\"108\",\"version\":\"0\",\"level\":\"4\",\"task\":\"108\",\"opcode\":\"0\",\"keywords\":\"0x8000000000000000\",\"systemTime\":\"2021-12-21T14:23:20.012913000Z\",\"eventRecordID\":\"24
86746518\",\"processID\":\"808\",\"threadID\":\"4724\",\"channel\":\"Microsoft-Windows-TaskScheduler/Operational\",\"computer\":\"Plugins-ADFS.logpoint.local\",\"severityValue\":\"INFORMATION\",\"message\":\"\\\
"Task Scheduler launched \\\"{00000000-0000-0000-0000-000000000000}\\\" instance of task \\\"\\\\Event Viewer Tasks\\\\Microsoft-Windows-TaskScheduler_Operational\\\" according to an event trigger.\\\"\"},\"ev
entdata\":{\"taskName\":\"\\\\\\\\Event Viewer Tasks\\\\\\\\Microsoft-Windows-TaskScheduler_Operational\",\"instanceId\":\"{00000000-0000-0000-0000-000000000000}\"}}}","decoder":{"name":"windows_eventchannel"},"
data":{"win":{"system":{"providerName":"Microsoft-Windows-TaskScheduler","providerGuid":"{DE7B24EA-73C8-4A09-985D-5BDADCFA9017}","eventID":"108","version":"0","level":"4","task":"108","opcode":"0","keywords":"0x
8000000000000000","systemTime":"2021-12-21T14:23:20.012913000Z","eventRecordID":"
2486746518","processID":"808","threadID":"4724","channel":"Microsoft-Windows-TaskScheduler/Operational","computer":"Plugins-ADFS.l
ogpoint.local","severityValue":"INFORMATION","message":"\"Task Scheduler launched \"{00000000-0000-0000-0000-000000000000}\" instance of task \"\\Event Viewer Tasks\\Microsoft-Windows-TaskScheduler_Operational\
" according to an event trigger.\""},"eventdata":{"taskName":"\\\\Event Viewer Tasks\\\\Microsoft-Windows-TaskScheduler_Operational","instanceId":"{00000000-0000-0000-0000-000000000000}"}}},"location":"EventCha
nnel"},"location":"\\Users\\asus\\test.txt"}
Into /var/ossec/logs/alerts/alerts.json it's looks like:
{"timestamp":"2021-12-29T12:36:30.437-0300","rule":{"level":4,"description":"Allow all logs","id":"111111","firedtimes":2,"mail":false,"groups":["local","syslog","sshd"]},"agent":{"id":"001","name":"DESKTOP-U8OHD3A","ip":"192.168.100.72"},"manager":{"name":"chb-VBox"},"id":"1640792190.3097636","decoder":{"name":"json"},"data":{"id":"1640096603.336656","timestamp":"2021-12-21T14:23:23.904+0000","agent":{"id":"003","name":"Plugins-ADFS","ip":"*****"},"manager":{"name":"*****"},"full_log":"{\"win\":{\"system\":{\"providerName\":\"Microsoft-Windows-TaskScheduler\",\"providerGuid\":\"{DE7B24EA-73C8-4A09-985D-5BDADCFA9017}\",\"eventID\":\"108\",\"version\":\"0\",\"level\":\"4\",\"task\":\"108\",\"opcode\":\"0\",\"keywords\":\"0x8000000000000000\",\"systemTime\":\"2021-12-21T14:23:20.012913000Z\",\"eventRecordID\":\"2486746518\",\"processID\":\"808\",\"threadID\":\"4724\",\"channel\":\"Microsoft-Windows-TaskScheduler/Operational\",\"computer\":\"Plugins-ADFS.logpoint.local\",\"severityValue\":\"INFORMATION\",\"message\":\"\\\"Task Scheduler launched \\\"{00000000-0000-0000-0000-000000000000}\\\" instance of task \\\"\\\\Event Viewer Tasks\\\\Microsoft-Windows-TaskScheduler_Operational\\\" according to an event trigger.\\\"\"},\"eventdata\":{\"taskName\":\"\\\\\\\\Event Viewer Tasks\\\\\\\\Microsoft-Windows-TaskScheduler_Operational\",\"instanceId\":\"{00000000-0000-0000-0000-000000000000}\"}}}","decoder":{"name":"windows_eventchannel"},"data":{"win":{"system":{"providerName":"Microsoft-Windows-TaskScheduler","providerGuid":"{DE7B24EA-73C8-4A09-985D-5BDADCFA9017}","eventID":"108","version":"0","level":"4","task":"108","opcode":"0","keywords":"0x8000000000000000","systemTime":"2021-12-21T14:23:20.012913000Z","eventRecordID":"2486746518","processID":"808","threadID":"4724","channel":"Microsoft-Windows-TaskScheduler/Operational","computer":"Plugins-ADFS.logpoint.local","severityValue":"INFORMATION","message":"\"Task Scheduler launched \"{00000000-0000-0000-0000-000000000000}\" instance of task \"\\Event Viewer Tasks\\Microsoft-Windows-TaskScheduler_Operational\" according to an event trigger.\""},"eventdata":{"taskName":"\\\\Event Viewer Tasks\\\\Microsoft-Windows-TaskScheduler_Operational","instanceId":"{00000000-0000-0000-0000-000000000000}"}}},"location":"EventChannel"},"location":"\\Users\\asus\\test.txt"}
Let me know if that information is useful to you.
Regards.