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"
}
}
}