我已经使用elasticsearch主机配置了elastalert实例.我还创建了一个示例规则,它将在日志中匹配该模式时检查loglevel和alert.
一切都工作正常,我正在收到我的松弛通道上的警报.
唯一关心的是我收到的警报中的信息/数据.elastalert插件发送与我正在寻找的模式相关的所有属性; 但我对所有信息都不感兴趣.我所关心的只是一些特定的属性.
以下是我的规则示例:
# Alert when the rate of events exceeds a threshold
# (Optional)
# Elasticsearch host
es_host:
# (Optional)
# Elasticsearch port
es_port:
# (OptionaL) Connect with SSL to elasticsearch
#use_ssl: True
# (Optional) basic-auth username and password for elasticsearch
#es_username: someusername
#es_password: somepassword
# (Required)
# Rule name, must be unique
name: DB2 test Rule
# (Required)
# Type of alert.
# the frequency rule type alerts when num_events events occur with timeframe time …Run Code Online (Sandbox Code Playgroud) 我正在寻找Stack Overflow上的Hashtables的一些例子,并发现了这个:
Enumeration enumeration = companies.elements();
while ( enumeration.hasMoreElements() ) {
System.out.println("hashtable values: "+enumeration.nextElement());
}
Run Code Online (Sandbox Code Playgroud)
为什么我们使用Enumerations,特别是在Hashtables中它的意义是什么?