iis günlük dosyası UTF-8 biçiminde ayrıştırırken, aşağıda hata alıyorum ve ANSI formatını kullanarak günlük dosyasını ayrıştırdığımda hiçbir şey çalışmıyor Logstash Sadece konsolda "Logstash başlangıç tamamlandı" mesajını göster. Sunucumda neredeyse 1000 dosya var, her dosya formatını ANSI'den UTF-8'e değiştiremiyorum. Yapılandırma dosyasında değiştirmem gereken yere yardım edebilir misiniz? UTF-8 biçimindeki dosyaları ayrıştırırken hata ayıklama dosyasını da ekliyorum. Aynı kutuda elastik arama kullanıyorum ve tamamen çalışıyor. Ayrıca 127.0.0.1 ile port 9200'ü telnet edebiliyorum.logstash-2.2.2, windows, IIS günlük dosya formatı
Günlüğü örnek:
2016-03-26T05:40:40.764Z WIN-AK44913P759 2016-03-24 00:16:31 W3SVC20 ODSANDBOXWEB01 172.x.x.x GET /healthmonitor.axd - 80 - 172.x.x.x HTTP/1.1 - - - www.xyz.net 200 0 0 4698 122 531
stdout çıkışı:
Aşağıda{
"message" => "2016-03-24 04:43:02 W3SVC20 ODSANDBOXWEB01 172.x.x.x GET /healthmonitor.axd - 80 - 172.x.x.x HTTP/1.1 - - - www.xyz.net 200 0 0 4698 122 703\r",
"@version" => "1",
"@timestamp" => "2016-03-26T05:42:15.045Z",
"path" => "C:\\IISLogs/u_ex160324.log",
"host" => "WIN-AK44913P759",
"type" => "IISLog",
"tags" => [
[0] "_grokparsefailure"
]
}
input {
file {
type => "IISLog"
path => "C:\IISLogs/u_ex*.log"
start_position => "beginning"
}
}
filter {
#ignore log comments
if [message] =~ "^#" {
drop {}
}
grok {
match => ["message", "%{TIMESTAMP_ISO8601:log_timestamp} %{WORD:iisSite} %{IPORHOST:site} %{WORD:method} %{URIPATH:page} %{NOTSPACE:querystring} %{NUMBER:port} %{NOTSPACE:username} %{IPORHOST:clienthost} %{NOTSPACE:useragent} %{NOTSPACE:referer} %{NUMBER:response} %{NUMBER:subresponse} %{NUMBER:scstatus} %{NUMBER:bytes:int} %{NUMBER:timetaken:int}"]
}
#Set the Event Timesteamp from the log
date {
match => [ "log_timestamp", "YYYY-MM-dd HH:mm:ss" ]
timezone => "Etc/UCT"
}
useragent {
source=> "useragent"
prefix=> "browser"
}
mutate {
remove_field => [ "log_timestamp"]
}
}
# output logs to console and to elasticsearch
output {
stdout {}
elasticsearch {
hosts => ["127.0.0.1:9200"]
}
stdout {
codec => rubydebug
}
}
. Benim durumumda 172.x.x.x anlamı normal IP adresi formatıdır. Grok deseni oluşturmak için herhangi bir yardım var mı. Elastic search & logstash ile biraz yeniyim. – Gparmar
172.x.x.x ifadesinin ne anlama geldiğini biliyordum, ancak bu giriş hiçbir zaman% {IP} ile eşleşmeyeceğinden, deseninizi hata ayıklamak için daha fazla iş yapmanıza yardımcı olmaya çalışanları yapıyorsunuz. Başka bir geçerli IP'ye değiştirdiyseniz, hata ayıklamak daha kolay olurdu. Grok öğrenmeye gelince, belki de buradan başlayın: http://svops.com/blog/introduction-to-logstash-grok-patterns/ –