Archive
Highlighted

how to blacklist the text data using regular expression in inputs.conf for the windows Event Code

Explorer

Below is the sample event for event code 4624 , i want to filter unnecessary text data( which is in bold letters) by creating regular expression in inputs.conf

inputs.conf
[WinEventLog://Security]
disabled = 0
whitelist = 4624,4625
blacklist = _raw = (Regular expression)

Process Information:
Process ID: 0x0
Process Name: -

Network Information:
Workstation Name:XXXXXXXX
Source Network Address: XXXXXXXXXX
Source Port: XXXXXXX

Detailed Authentication Information:
Logon Process: XXXXXXX
Authentication Package: XXXXXXX
Transited Services: -
Package Name (NTLM only): XXXXXX
Key Length: 0

This event is generated when a logon session is created. It is generated on the computer that was accessed.
The subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe.
The logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network).
The New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on.
The network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases.
The authentication information fields provide detailed information about this specific logon request.
- Logon GUID is a unique identifier that can be used to correlate this event with a KDC event.
- Transited services indicate which intermediate services have participated in this logon request.
- Package name indicates which sub-protocol was used among the NTLM protocols.
- Key length indicates the length of the generated session key. This will be 0 if no session key was requested.

Tags (1)
0 Karma
Highlighted

Re: how to blacklist the text data using regular expression in inputs.conf for the windows Event Code

Legend

You can't do what you want in inputs.conf. The inputs.conf.spec documentation for Windows Event inputs says

[WinEventLog://<name>]
blacklist = <list of eventIDs> | key=regex [key=regex]

But "key" is not a field, not even _raw. Fields do not exist at input time. You can find the list of keys here. And you can't do a replace operation with the regular expression in inputs.conf - events that match the regex are either eliminated (blacklist) or processed (whitelist).

Replacing data can be done at parsing time. Using props.conf, you can search-and-replace with the SEDCMD like this

SEDCMD-elim=(.*Key:\s\d+).*/\1/

But this will only work if the last part of the event contains the Key field. If your events can have different formats, consider using TRUNCATE in props.conf instead. This sets the maximum number of characters in an event. Just make sure that the number you choose is large enough to always capture the data that you want. Some events will have "junk" at the end, but not so much.

TRUNCATE = <non-negative integer>
0 Karma