$re = '/Process Command Line:\s+(C:\\\\Program Files\\\\Splunk\\\\.*)/m';
$str = 'LogName=Example
SourceName=Microsoft Windows something or another.
EventCode=4688
EventType=0
Type=Information
ComputerName=DESKTOP-PFN2BRQ
TaskCategory=Logon
OpCode=Info
RecordNumber=16010
Keywords=Audit Success
Message=An account was successfully logged on.
Process Command Line: C:\\Program Files\\Splunk\\bin\\splunk.exe command
Subject:
Security ID: NT AUTHORITY\\SYSTEM
Account Name: DESKTOP-PFN2BRQ$
Account Domain: SPLUNK
Logon ID: 0x3E7
Logon Information:
Logon Type: 2
Restricted Admin Mode: -
Virtual Account: Yes
Elevated Token: No
Impersonation Level: Impersonation
New Logon:
Security ID: Window Manager\\lansweeper-sa
Account Name: lansweeper-sa
Account Domain: Window Manager
Logon ID: 0x6F5EE0
Linked Logon ID: 0x6F5E8D
Network Account Name: -
Network Account Domain: -
Logon GUID: {00000000-0000-0000-0000-000000000000}
Process Information:
Process ID: 0x30e8
Process Name: C:\\Windows\\System32\\winlogon.exe
Network Information:
Workstation Name: -
Source Network Address: -
Source Port: -
Detailed Authentication Information:
Logon Process: Advapi
Authentication Package: Negotiate
Transited Services: -
Package Name (NTLM only): -
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 impersonation level field indicates the extent to which a process in the logon session can impersonate.
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.';
preg_match_all($re, $str, $matches, PREG_SET_ORDER, 0);
// Print the entire match result
var_dump($matches);
Please keep in mind that these code samples are automatically generated and are not guaranteed to work. If you find any syntax errors, feel free to submit a bug report. For a full regex reference for PHP, please visit: http://php.net/manual/en/ref.pcre.php