Hello everyone...
I have multiple event logs from windows. Converted them to csv using EvtxEcmd.exe.
I combined lots of event logs into one csv file. I need to upload it to ELK. below are the column names-
RecordNumber,EventRecordId,TimeCreated,EventId,Level,Provider,Channel,ProcessId,ThreadId,Computer,ChunkNumber,UserId,MapDescription,UserName,RemoteHost,PayloadData1,PayloadData2,PayloadData3,PayloadData4,PayloadData5,PayloadData6,ExecutableInfo,HiddenRecord,SourceFile,Keywords,ExtraDataOffset,Payload
Below is a sample log line (I picked which could be possibly longest one).
3308,530390,2021-07-01 09:20:40.6757225,4016,Info,Microsoft-Windows-GroupPolicy,Microsoft-Windows-GroupPolicy/Operational,10840,1104,DESKTOP-2C7Q9UJ.mydomain.com,42,S-1-5-18,,,,,,,,,,,False,z:\desktop-Event_Logs\DESKTOP-2C7Q9UJ-Microsoft-Windows-GroupPolicy-Operational.evtx,0x4000000000000000,0,"{""EventData"":{""Data"":[{""@Name"":""CSEExtensionId"",""#text"":""827d319e-6eac-11d2-a4ea-00c04f79f83a""},{""@Name"":""CSEExtensionName"",""#text"":""Security""},{""@Name"":""IsExtensionAsyncProcessing"",""#text"":""True""},{""@Name"":""IsGPOListChanged"",""#text"":""False""},{""@Name"":""GPOListStatusString"",""#text"":""%%4101""},{""@Name"":""DescriptionString"",""#text"":""Default Domain Policy, Deny Logon locally for service account, ""},{""@Name"":""ApplicableGPOList"",""#text"":""<GPO ID=""{31B2F340-016D-11D2-945F-00C04FB984F9}""><Name>Default Domain Policy</Name></GPO><GPO ID=""{534B3EFE-DA09-40FA-B138-C526C40F272D}""><Name>Deny Logon locally for service account</Name></GPO>""}]}}"
The last column "Payload" contains too much nested information in json, then list then json (starts with "{""EventData""). The json fields with @name
and #test
may vary depending on the log.
Can someone guide me how to create config file for this? Plz explain the mappings clearly because I may need to go other route also using different format.
Another method, I worked abit with SED and converted the logline to below using ubuntu terminal. Removed the nested json mappings and renamed @name to name1, name2, name3 contd.. and #text to text1, text2, text3 contd..
3308,530390,2021-07-01 09:20:40.6757225,4016,Info,Microsoft-Windows-GroupPolicy,Microsoft-Windows-GroupPolicy/Operational,10840,1104,DESKTOP-22222.myDomain.com,42,S-1-5-18,,,,,,,,,,,False,z:\desktop-Event_Logs\DESKTOP-22222-Microsoft-Windows-GroupPolicy-Operational.evtx,0x4000000000000000,0,"Data":{"name1":"CSEExtensionId","text1":"827d319e-6eac-11d2-a4ea-00c04f79f83a","name2":"CSEExtensionName","text2":"Security","name3":"IsExtensionAsyncProcessing","text3":"True","name4":"IsGPOListChanged","text4":"False","name5":"GPOListStatusString","text5":"%%4101","name6":"DescriptionString","text6":"Default Domain Policy, Deny Logon locally for service account, ","Name7":"ApplicableGPOList","text7":"<GPO ID="{33322340-016D-11D2-945F-00C04FB984F9}"><Name>Default Domain Policy</Name></GPO><GPO ID="{534B3EFE-DA09-40FA-B138-C526C40F272D}"><Name>Deny Logon locally for service account</Name></GPO>"}
Here I converted whole nested jsons into single json with the key "Data"
(plz correct me if my understanding of creating a json is wrong here, but I've tried all kind of combinations). When I upload this file to ELK, i get csvparsefailure.
Plz point out where am I wrong.