Skip to content

Commit 8ed0d52

Browse files
committed
Configure logstash to send logs to Elasticsearch
1 parent 3052be1 commit 8ed0d52

1 file changed

Lines changed: 28 additions & 0 deletions

File tree

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
input {
2+
tcp {
3+
port => 5000
4+
type => syslog
5+
codec => json_lines
6+
}
7+
}
8+
9+
filter {
10+
grok {
11+
match => [ "message", "%{GREEDYDATA}" ]
12+
}
13+
mutate {
14+
add_field => { "instance_name" => "%{app_name}-%{host}:%{app_port}" }
15+
}
16+
}
17+
18+
output {
19+
stdout { # This will log all messages so that we can confirm that Logstash is receiving them
20+
codec => rubydebug
21+
}
22+
elasticsearch {
23+
hosts => [ "${XPACK_MONITORING_ELASTICSEARCH_HOSTS}" ]
24+
user => "${XPACK_MONITORING_ELASTICSEARCH_USERNAME}"
25+
password => "${XPACK_MONITORING_ELASTICSEARCH_PASSWORD}"
26+
index => "logstash-%{+YYYY.MM.dd}"
27+
}
28+
}

0 commit comments

Comments
 (0)