Skip to content

Instantly share code, notes, and snippets.

@serjs
Created November 28, 2018 06:46
Show Gist options
  • Save serjs/878efc0d391e156100ec95db25efa5d9 to your computer and use it in GitHub Desktop.
Save serjs/878efc0d391e156100ec95db25efa5d9 to your computer and use it in GitHub Desktop.
input {
beats {
port => 5044
host => "0.0.0.0"
}
}
filter {
grok {
match => ["message",
# 2018-04-26 12:30:36.466 INFO 41778 --- [nio-8080-exec-1] n.e.e.ELKController : /validrequest - Hello user! Today's date: Thu Apr 26 12:30:36 MSK 2018
"(?<timestamp>%{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{TIME}) [ ]{1,}%{LOGLEVEL:log_level} %{NUMBER:pid} --- \[(?<thread>[A-Za-z0-9-]+)\] [A-Za-z0-9.]*\.(?<class>[A-Za-z0-9#_]+)\s*:\s+(?<logmessage>.*)",
"message",
# 2018-04-26 12:30:36.466 INFO 41778 ---
"(?<timestamp>%{YEAR}-%{MONTHNUM}-%{MONTHDAY} %{TIME}) %{LOGLEVEL:log_level} %{NUMBER:pid} --- .+? :\s+(?<logmessage>.*)"
]
}
date {
match => [ "timestamp" , "yyyy-MM-dd HH:mm:ss.SSS" ]
}
}
output {
elasticsearch {
hosts => "35.241.173.27:9200"
index => "logstash-training"
user => "elastic"
password => "testr"
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment