Hey gang. I am working with our dev team and they are dumping custom logging into the windows events
Using winlogbeat to ship the log entries into logstash i am trying to set up a central pipeline to handle the different api logs.
I am having trouble splitting up the data and it's all ending up in param1.
The windows log data is coming in like this:
Identifier: c27948fe-af6e-42e2-9db6-338f1d48f9e0
IdentifierType: Test LogEvent
ApplicationName: LoggingNuget-Tester
Severity: Debug
LogType:
Name: Error talking to database
Description: Something went wrong in the operation.
FullStackTrace: Unable to find the specified file.
AuditCreatedDate: 12/17/2020 4:55:56 PM
Using the beats input and regular winlogs flow right through no problem to elasticsearch
My filter looks like this:
if [winlog][channel] == "LoggingAPI" {
if [message] =~ "Identifier: " { grok { match => { "message" => "Identifier: %{DATA:log.identifier}" } } }
if [message] =~ "IdentifierType: " { grok { match => { "message" => "IdentifierType: %{DATA:log.identifierType}" } } }
if [message] =~ "ApplicationName: " { grok { match => { "message" => "ApplicationName: %{DATA:log.applicationName}" } } }
if [message] =~ "Severity: " { grok { match => { "message" => "Severity: %{DATA:log.severity}" } } }
if [message] =~ "LogType: " { grok { match => { "message" => "LogType: %{DATA:log.logType}" } } }
if [message] =~ "Name: " { grok { match => { "message" => "Name: %{DATA:log.name}" } } }
if [message] =~ "Description: " { grok { match => { "message" => "Description: %{DATA:log.description}" } } }
if [message] =~ "FullStackTrace: " { grok { match => { "message" => "FullStackTrace: %{GREEDYDATA:log.fullStackTrace}" } } }
mutate{ add_tag => [ "logging-api-via-logstash" ]}
}
The only line that makes it into it's own field is the last one "FullStackTrace" (of course that brings along the darn AuditCreatedDate
If I try to use GREEDYDATA on the other lines it pulls the next line or more of data.
I don't think I understand on how to get the value but stop at the new line.
These logging events should never take up more than one line .. except of course the fullstacktrace.
What am I doing wrong here?
Thanks