i will try rephrase and space out the code as best i can... i am not used to posting here as you can see.
i am using winlogbeat to collect application, security and system logs, these seem to be the most common feilds accross all three, i require them as i would like to forward information to external database later on
I am looking to extract these feilds:
[message] [host.architecture] [host.os.version] [host.os.name] [host.os.kernel] [host.os.build] [host.hostname] [host.id] [host.name], [type] [agent.type] [agent.id] [agent.version], [@timestamp], [winlog.provider_name] [winlog.process.thread.id] [winlog.keyword] [winlog.event_data.TargetUserName] [winlog.channel] [event.created] [event.kind] [log.level]
below is the ouput of my pipeline in the cmd, i have applied no filter and would like to know how to create one using grok.
{
"message" => "A user's local group membership was enumerated.\n\nSubject:\n\tSecurity ID:\t\tS-1-5-18\n\tAccount Name:\t\tDESKTOP-LMVLRUC$\n\tAccount Domain:\t\tWORKGROUP\n\tLogon ID:\t\t0x3E7\n\nUser:\n\tSecurity ID:\t\tS-1-5-21-3748035913-1059597750-253446-1001\n\tAccount Name:\t\tadamb\n\tAccount Domain:\t\tDESKTOP-LMVLRUC\n\nProcess Information:\n\tProcess ID:\t\t0x29f4\n\tProcess Name:\t\tC:\\Windows\\System32\\svchost.exe",
"@version" => "1",
"host" => {
"architecture" => "x86_64",
"os" => {
"version" => "10.0",
"family" => "windows",
"kernel" => "10.0.18362.628 (WinBuild.160101.0800)",
"name" => "Windows 10 Home",
"build" => "18363.628",
"platform" => "windows"
},
"hostname" => "DESKTOP-LMVLRUC",
"id" => "b0733bdc-476e-4005-9066-b13849a0c783",
"name" => "DESKTOP-LMVLRUC"
},
"type" => "log",
"agent" => {
"type" => "winlogbeat",
"ephemeral_id" => "f634378a-a8a2-46e2-914a-96f8dffc909b",
"hostname" => "DESKTOP-LMVLRUC",
"id" => "ac81bd49-e2b2-4bde-a3e4-b295ce5b52bb",
"version" => "7.5.2"
},
"tags" => [
[0] "beats_input_codec_plain_applied"
],
"@timestamp" => 2020-02-11T19:09:13.821Z,
"winlog" => {
"process" => {
"thread" => {
"id" => 944
},
"pid" => 864
},
"provider_name" => "Microsoft-Windows-Security-Auditing",
"provider_guid" => "{54849625-5478-4994-a5ba-3e3b0328c30d}",
"event_id" => 4798,
"task" => "User Account Management",
"computer_name" => "DESKTOP-LMVLRUC",
"activity_id" => "{bd1bfc0b-e109-0003-2cfc-1bbd09e1d501}",
"opcode" => "Info",
"record_id" => 35109,
"api" => "wineventlog",
"event_data" => {
"TargetSid" => "S-1-5-21-3748035913-1059597750-253446-1001",
"SubjectUserName" => "DESKTOP-LMVLRUC$",
"CallerProcessName" => "C:\\Windows\\System32\\svchost.exe",
"SubjectLogonId" => "0x3e7",
"TargetDomainName" => "DESKTOP-LMVLRUC",
"CallerProcessId" => "0x29f4",
"SubjectUserSid" => "S-1-5-18",
"SubjectDomainName" => "WORKGROUP",
"TargetUserName" => "adamb"
},
"keywords" => [
[0] "Audit Success"
],
"channel" => "Security"
},
"ecs" => {
"version" => "1.1.0"
},
"event" => {
"action" => "User Account Management",
"code" => 4798,
"provider" => "Microsoft-Windows-Security-Auditing",
"created" => "2020-02-11T19:09:15.179Z",
"kind" => "event"
},
"log" => {
"level" => "information"
}
}
thank you!