我刚刚在Windows上构建了一个ELK服务器,所以我对这个过程还不熟悉。我已经通读了文档,但是在解析出我的IIS高级日志时遇到了麻烦,特别是当我们在负载均衡器后面时,对于数据的x转发。
我的高级日志设置为输出如下数据:
$date, $time, $s-ip, $cs-uri-stem, $cs-uri-query, $s-port, $cs-username, $c-ip, $X-Forwarded-For, $csUser-Agent, $cs-Referer, $sc-status, $sc-substatus, $sc-win32-status, $time-taken我这样设置我的logstash.conf:
input {
tcp {
host => "localhost"
type => "iis"
port => 5044
}
}
filter {
if [type] == "iis" {
grok {
match => {"message" => "%{TIMESTAMP_ISO8601:log_timestamp} %{IPORHOST:site} %{URIPATH:page} %{NOTSPACE:query_string} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:client_host} %{NOTSPACE:useragent} %{NOTSPACE:referer} %{GREEDYDATA:response} %{NUMBER:httpStatusCode:int} %{NUMBER:scSubstatus:int} %{NUMBER:scwin32status:int} %{NUMBER:timeTakenMS:int}"}
}
}
}
output {
elasticsearch {
hosts => ["localhost:9200"]
index => "iis"
document_type => "main"
}
}我不认为这是正确的,因为我没有得到数据。我已经搜索了文档,但仍然有问题,不确定是否还有其他步骤需要我采取,如映射字段。
我目前正在使用来自一台服务器的filebeat将数据推送到我的ELK服务器。我不确定这是否也是最好的方法(也许是nxlog?)。我们不想在客户机上安装logstash。
有人能帮我一下吗?非常感谢!
谢谢,乔治
https://stackoverflow.com/questions/38352655
复制相似问题