kibana图形展示
x轴为metrics,如account,max,min等
y轴为聚合条件,如按时间显示,按地区显示,按host显示等等
filter插件设置
可以定义语句与正则表达式匹配
filter {
if [source] == "/var/log/httpd/access_log" {
grok {
match => { "message" => "%{COMBINEDAPACHELOG}" }
}
}
else if [source] == "/var/log/messages" {
grok {
match => { "message" => "%{SYSLOGBASE2}"}
match => { "message" => "%{SYSLOGPAMSESSION}"}
}
}
}
%{COMBINEDAPACHELOG}是已经定义好的正则表达式,可以在官网中查询应用所需要的正则表达式,也可以自己定义
但是使用正则表达式将会大大占用CPU资源logstash中定义index
可以使用命令直接定义
input {
udp {
...
type => "foo"
}
file {
...
type => "bar"
}
}
output {
if [type] == "foo" {
elasticsearch {
...
index => "foo-index"
}
} else {
elasticsearch {
...
index => "bar-index"
}
}
}