Hi, this error is because you are monitoring a folder instead of a file, if you want to monitor a file, you must put the full path of the file and you must have a rule for that match when parsing each line in the file. if you don't have a rule, you won't see anything in alert.json.
<localfile>
<location>C:\Users\vagrant\Documents\filelogs.txt</location>
<log_format>syslog</log_format>
</localfile>
if you want to monitor the integrity of the folder, you can use syscheck, for any change, modification, creation in the folder or in any file in the folder it will generate an alert in alert.json
<syscheck>
<directories check_all="yes" realtime="yes">C:\Test</directories>
</syscheck>
output in alert.json:
{"timestamp":"2022-10-31T11:25:14.155-0500","rule":{"level":5,"description":"File added to the system.","id":"554","firedtimes":4,"mail":false,"groups":["ossec","syscheck","syscheck_entry_added","syscheck_file"],"pci_dss":["11.5"],"gpg13":["4.11"],"gdpr":["II_5.1.f"],"hipaa":["164.312.c.1","164.312.c.2"],"nist_800_53":["SI.7"],"tsc":["PI1.4","PI1.5","CC6.1","CC6.8","CC7.2","CC7.3"]},"agent":{"id":"015","name":"DESKTOP-QCL0GB6","ip":"FE80:0000:0000:0000:XXXX:XXXX:XXXX:XXXX"},"manager":{"name":"thejbte-ASUS-TUF-A15"},"id":"1667233514.728335","full_log":"File 'c:\\test\\new text document (3).txt' added\nMode: realtime\n","syscheck":{"path":"c:\\test\\new text document (3).txt","mode":"realtime","size_after":"0","win_perm_after":[{"name":"Administrators","allowed":["DELETE","READ_CONTROL","WRITE_DAC","WRITE_OWNER","SYNCHRONIZE","READ_DATA","WRITE_DATA","APPEND_DATA","READ_EA","WRITE_EA","EXECUTE","READ_ATTRIBUTES","WRITE_ATTRIBUTES"]},{"name":"SYSTEM","allowed":["DELETE","READ_CONTROL","WRITE_DAC","WRITE_OWNER","SYNCHRONIZE","READ_DATA","WRITE_DATA","APPEND_DATA","READ_EA","WRITE_EA","EXECUTE","READ_ATTRIBUTES","WRITE_ATTRIBUTES"]},{"name":"Users","allowed":["READ_CONTROL","SYNCHRONIZE","READ_DATA","READ_EA","EXECUTE","READ_ATTRIBUTES"]},{"name":"Authenticated Users","allowed":["DELETE","READ_CONTROL","SYNCHRONIZE","READ_DATA","WRITE_DATA","APPEND_DATA","READ_EA","WRITE_EA","EXECUTE","READ_ATTRIBUTES","WRITE_ATTRIBUTES"]}],"uid_after":"S-1-5-32-544","md5_after":"d41d8cd98f00b204e9800998ecf8427e","sha1_after":"da39a3ee5e6b4b0d3255bfef95601890afd80709","sha256_after":"e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855","attrs_after":["ARCHIVE"],"uname_after":"Administrators","mtime_after":"2022-10-31T11:25:14","event":"added"},"decoder":{"name":"syscheck_new_entry"},"location":"syscheck"}
I don't understand the second question, can you explain me?
Regards