hello,
I am trying to write some logstash rules to capture log on/off events on Windows machines.
To extract security events from the Eventvwr I do something like that on eventvwr:
$starttime = (get-date).addhours(-1)
$data = Get-WinEvent -FilterHashtable @{logname="Security"; starttime=$starttime} | ConvertTo-Json -depth 3
$data
I can write the "$data" to a file but I am having difficulties to stream that on logstash to do some testing. The $data is usually a kind of json file e.g.:
{
"Id": 4624,
"Version": 2,
"Qualifiers": null,
"Level": 0,
"Task": 12544,
"Opcode": 0,
"Keywords": -9214364837600034816,
"RecordId": 626044,
"ProviderName": "Microsoft-Windows-Security-Auditing",
"ProviderId": "54849625-5478-4994-aa-3e3b0328c30d",
"LogName": "Security",
"ProcessId": 660,
"ThreadId": 3964,
"MachineName": "XXXX.XXXX",
"UserId": null,
"TimeCreated": "\/Date(1540658683600)\/",
"ActivityId": "53e729eb-65f9-0003-e9-e753f965d401",
"RelatedActivityId": null,
"ContainerLog": "security",
"MatchedQueryIds": [
],
"Bookmark": {
},
"LevelDisplayName": "Information",
"OpcodeDisplayName": "Info",
"TaskDisplayName": "Logon",
"KeywordsDisplayNames": [
"Audit Success"
],
"Properties": [
{
"Value": "S-1-5-18"
},
...
}
how I can pipe this to my logstash for testing purpose?
I am looking at the multiline codec, file plugin but I dont manage to be able to properly parse the json in my test event.
I am running logstash 5.6.12. Sadly I didnt manage to go around this issue with these hints Indexing JSON files from a local directory to elastic
Thank you for any hint!