Skip to content

Instantly share code, notes, and snippets.

@MrBasset
MrBasset / log-reader.ps1
Last active August 29, 2015 14:23 — forked from sean-m/log-reader-config.ps1
Forked from sean-m/log-reader-config.ps1. I changed the script so that logstash-forwarder is started as a process and the json event messages are pushed to the stdin of logstash-forwarder. I don't know how this will be affected by network connectivity, but it means I don't need to worry about a log file on the C: drive growing ever larger.
#Requires -Version 3
param (
[string]$lognames
)
#reading security log requires elevated privileges so only read Application and System for now
[string[]]$logname = $("Application", "System" )
if ($lognames)
{