I'm using Winlogbeat to push Forwarded Event to logstash but I have the following problem:
It seems that Windows 7 clients can't reliably fill the "RenderingInfo" section of the events: some of them contain only the "Message" part, or no renderinginfo at all, etc...
I noticed that when there is a "RenderingInfo" section on the event, Winlogbeat seems to ignore the original "Level" (for example) and replaces it with the Level in the "RenderingInfo" section, but, when the RendringInfo Level is empty, I think that Winlogbeat should fallback on the "raw" level which is always populated.
The problem here is that a lot of event in Elasticsearch are recorded without the "Level" information probably because of the almost empty RenderingInfo section
One of these events here, as you can see, the renderinginfo is "empty", and the event published in Elasticsearch doesn't contains the event level (4, in the Event.System part of the XML)
This is where Level is added to the output. Some logic could be added to fallback to LevelRaw when Level is empty. And logic already exists to convert the number to a string. Just need to do a eventlogging.EventType(LevelRaw).String() to convert it to string.
OK, I can contribute to the project, but I've found another problem by looking at the code: The levels in the logic to convert the LevelRaw number to a string are only valid for Windows XP and below.
Now (since Vista), we have:
LogAlways (default level if nothing is specified, the event viewer assumes it's Informational), Critical, Error, Warning, Informational, Verbose
The EventType I referenced is in the eventlogging package which is specifically for the Event Logging API (pre-Windows Vista). We must maintain capability with pre-Vista versions, so it seems that we cannot change or reuse EventType.
The wineventlog package is for the Windows Event Log API (vista and newer). So that package is probably the best place to put any new types specifically for vista and newer.
And I previously mentioned that the eventlog.go file would be the place to add the fallback logic, but this is common to both the old and new event log APIs. So it probably needs to perform the fallback to LevelRaw in code specific to the newer API. This file would be a good place.
Apache, Apache Lucene, Apache Hadoop, Hadoop, HDFS and the yellow elephant
logo are trademarks of the
Apache Software Foundation
in the United States and/or other countries.