input {
beats {
port => 5044
tags => ["winlogbeat"]
}
}
filter {
if "winlogbeat" in [tags] {
if [winlog][event_data][LogonType] {
ruby {
code => " dict = { '0'=>'System', '1'=>'Unknown', '2'=>'Interactive', '3'=>'Network', '4'=>'Packet', '5'=>'As service', '6'=>'Proxy', '7'=>'Lock Release (Locally)', '8'=>'Network (plain text)', '9'=>'New account', '10'=>'Interactive (remotely)', '11'=>'Interactive (from cache)', '12'=>'Interactive (remotely, from cache)', '13'=>'Unlock (from cache)' };
key = event.get('[winlog][event_data][LogonType]');
event.set('[winlog][event_data][LogonType]', dict[key]); "
}
}
if [beat][hostname] {
ruby {code => "event['beat']['hostname'] = event['beat']['hostname'].downcase;"}
}
}
}
output {
if "winlogbeat" in [tags] {
elasticsearch {
hosts => ["10.10.1.200:9200"]
index => "winlogbeat-%{+YYYY.MM.dd}"
user => "******"
password => "*******"
}
}
}