Logstash How do I pull logs from Redis and write to Es?
Input {
Redis {
Batch_count = 1
Host = "Sz-a-xxxxxredis01-redis-xen.xxxxx.com"
Type = "Syslog"
data_type = "List"
Key = "Logstash:syslog-log"
}
Redis {
Batch_count = 1
Host = "Sz-a-xxxxxredis01-redis-xen.xxxxx.com"
Type = "Log4j-json-web"
data_type = "List"
Key = "Logstash:xxxxxweb-web-log"
}
Redis {
Batch_count = 1
Host = "Sz-a-xxxxxredis01-redis-xen.xxxxx.com"
Type = "Log4j-json-tomcat"
data_type = "List"
Key = "Logstash:xxxxxweb-tomcat-log"
}
}
output{
if [type] = = "Syslog" {
Elasticsearch {hosts = ["Sz-a-xxxxxes01-es-hw.xxxxx.com"]
index = "dev-system-logs-%{+yyyy. MM.DD} "
Document_type = "System-logs"}
}
if [type] = = "Log4j-json-web" {
Elasticsearch {hosts = ["Sz-a-xxxxxes01-es-hw.xxxxx.com"]
index = "dev-xxxxxweb-master-logs-%{+yyyy. MM.DD} "
Document_type = "%{class}"}
}
if [type] = = "Log4j-json-tomcat" {
Elasticsearch {hosts = ["Sz-a-xxxxxes01-es-hw.xxxxx.com"]
index = "dev-xxxxxweb-master-logs-%{+yyyy. MM.DD} "
Document_type = "Tomcat_logs"}
}
}
The above configuration also involves the transmission of Rsyslog logs, drawing on the configuration of another great God, his blog address: http://dl528888.blog.51cto.com
Summarize
In the end of this article is actually less kibana effect display, is because the display diagram is still in perfect, in the later narrative, will show some kibana rendering effect.
elkstack-based on Java Engineering Tomcat Application log processing-02