对于LogStash及其过滤机制,我是一个初学者。 我试过谷歌,但我似乎没有得到我的问题的答案(或我自己无法理解答案)。 我使用syslog代理(WinCollect)将数据发送到LogStash,但在Kibana中,我希望基于syslog“message”部分有几个可视化字段。 例如,此消息:
AgentDevice=WindowsLog AgentLogFile=Security PluginVersion=7.2.5.27 Source=Microsoft-Windows-Security-Auditing Computer=domaincontroller1.contoso.com OriginatingComputer=127.0.0.1 User= Domain= EventID=4624 EventIDCode=4624 EventType=8 EventCategory=12544 RecordNumber=595555663 TimeGenerated=1521725859 TimeWritten=1521725859 Level=0 Keywords=0 Task=0 Opcode=0 Message=An account was successfully logged on. Subject: Security ID: NULL SID Account Name: - Account Domain: - Logon ID: 0x0 Logon Type: 3 New Logon: Security ID: CONTOSO\u0111 Account Name: u0111 Account Domain: CONTOSO Logon ID: 0x2a376541 Logon GUID: {300CFB3A-32CF-8207-48C5-00000000000} Process Information: Process ID: 0x0 Process Name: - Network Information: Workstation Name: - Source Network Address: 10.0.0.1 Source Port: 55123 Detailed Authentication Information: Logon Process: Kerberos Authentication Package: Kerberos Transited Services: - Package Name (NTLM only): - Key Length: 0 This event is generated when a logon session is created. It is generated on the computer that was accessed. The subject fields indicate the account on the local system which requested the logon. This is most commonly a service such as the Server service, or a local process such as Winlogon.exe or Services.exe. The logon type field indicates the kind of logon that occurred. The most common types are 2 (interactive) and 3 (network). The New Logon fields indicate the account for whom the new logon was created, i.e. the account that was logged on. The network fields indicate where a remote logon request originated. Workstation name is not always available and may be left blank in some cases. The authentication information fields provide detailed information about this specific logon request. - Logon GUID is a unique identifier that can be used to correlate this event with a KDC event. - Transited services indicate which intermediate services have participated in this logon request. - Package name indicates which sub-protocol was used among the NTLM protocols. - Key length indicates the length of the generated session key. This will be 0 if no session key was requested.
如果我想根据此消息将“EventID”和“Computer”作为kibana中的字段,我将如何设置我的grok过滤器? 对不起,我的当前grok过滤器没有代码,因为它们都不起作用,我的配置很简单,只有syslog作为输入,elasticsearch作为输出。
答案 0 :(得分:0)
我将直接从您的过滤器部分开始
filter {
grok {
match => ["message","Computer=%{NOTSPACE:computer}"]
}
grok {
match => ["message", "EventID=%{INT:event_id}"]
}
# if you might want to drop other data
mutate {
remove_field => ["message"]
convert => { "event_id" => "integer" }
}
}
这不是唯一的方法,你可以做到。 如果有帮助请告诉我,谢谢!!