Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

in_winlog: fix "invalid UTF-8 bytes, skipping" #2322

Merged
merged 1 commit into from
Jul 3, 2020

Conversation

fujimotos
Copy link
Member

This adds the first cut at a more complete record serializer
for Windows Event logs.

In particular, this patch implements the message formatting
using registry keys. The format of a new data record looks
something like this:

    {"RecordNumber": 408,
     "TimeGenerated": "2020-06-22 06:26:31 +0900",
     "TimeWritten": "2020-06-22 06:26:31 +0900",
     "EventType": "Information",
     "EventCategory": 0,
     "Channel": "Application",
     "SourceName": "Microsoft-Windows-RestartManager",
     "ComputerName": "winsvr2019",
     "Data": "",
     "Sid": "",
     "Message": "Starting session 0 - 2020-06-22T06: 26:31.710405700Z."}

Note that every field is explicitly encoded into UTF-8 - this
guarantees that we can always safely convert records into JSON.

Signed-off-by: Fujimoto Seiji fujimoto@ceptord.net

This adds the first cut at a more complete record serializer
for Windows Event logs.

In particular, this patch implements the message formatting
using registry keys. The format of a new data record looks
something like this:

    {"RecordNumber": 408,
     "TimeGenerated": "2020-06-22 06:26:31 +0900",
     "TimeWritten": "2020-06-22 06:26:31 +0900",
     "EventType": "Information",
     "EventCategory": 0,
     "Channel": "Application",
     "SourceName": "Microsoft-Windows-RestartManager",
     "ComputerName": "winsvr2019",
     "Data": "",
     "Sid": "",
     "Message": "Starting session 0 - 2020-06-22T06: 26:31.710405700Z."}

Note that every field is explicitly encoded into UTF-8 - this
guarantees that we can always safely convert records into JSON.

Signed-off-by: Fujimoto Seiji <fujimoto@ceptord.net>
@fujimotos
Copy link
Member Author

This fixes #1949.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants