简体   繁体   中英

Windows event log Logstash and Elasticsearch filter doesn't work

I want to filter "New Process Name: C:\\Windows\\System32\\notepad.exe" in logstash.

Here the Windows Event log, created by ossec agent

** Alert 1460299512.116024: - windows,authentication_success,
2016 Apr 10 16:45:12 (windows10) 192.168.0.17->WinEvtLog
Rule: 18107 (level 3) -> 'Process Creation.'
User: (no user)
2016 Apr 10 07:45:09 WinEvtLog: Security: AUDIT_SUCCESS(4688): Microsoft-Windows-Security-Auditing: (no user): no domain: DESKTOP-2D562R2: A new process has been created. Subject:  Security ID:  S-1-5-21-3956991881-1104172218-599705502-1001  Account Name:  Localroot  Account Domain:  DESKTOP-2D562R2  Logon ID:  0x27c1e  Process Information:  New Process ID:  0x12a8  New Process Name: C:\Windows\System32\notepad.exe  Token Elevation Type: %%1938  Creator Process ID: 0x1a0`enter code here`

I use this filter in logstash

root@ubuntulogstash:/etc/logstash/conf.d# cat all.conf
input {
# stdin{}
  udp {
     port => 9000
     type => "syslog"
  }
}
filter {
  if [type] == "syslog" {
    grok {
      match => { "message" => "%{SYSLOGTIMESTAMP:syslog_timestamp} %{SYSLOGHOST:syslog_host} %{DATA:syslog_program}: Alert Level: %{BASE10NUM:Alert_Level}; Rule: %{BASE10NUM:Rule} - %{GREEDYDATA:Description}; Location: %{GREEDYDATA:Details}" }
      add_field => [ "ossec_server", "%{host}" ]
}
   }
    mutate {
      remove_field => [ "syslog_hostname", "syslog_message", "syslog_pid", "message", "@version", "type", "host" ]
    }
  }
}
output {
  elasticsearch {
        hosts => ["192.168.0.30:9200"]
        index => "ossec"
#       protocol => http
                }
stdout { codec => rubydebug }
}

Something like

New Process Name: %{NOTSPACE:processName}%SPACE

would work in a grok pattern

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM