Skip to content

Instantly share code, notes, and snippets.

@billryan
Last active August 16, 2016 08:36
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save billryan/f731de41c5687fb0c70ee2de817ee5ff to your computer and use it in GitHub Desktop.
Save billryan/f731de41c5687fb0c70ee2de817ee5ff to your computer and use it in GitHub Desktop.
# /etc/rsyslog.d/49-ship-syslog.conf
*.*;syslog;auth,authpriv.none action(
type="omfwd"
Target="logstash.marathon.mesos"
Port="5001"
Protocol="tcp"
)
input {
tcp {
port => 5000
type => docker
}
tcp {
port => 5001
type => rsyslog
}
}
filter {
if [type] == "rsyslog" {
grok {
match => { "message" => "<%{POSINT:priority}>%{TIMESTAMP_ISO8601:syslog_timestamp} %{SYSLOGHOST:syslog_hostname} %{DATA:syslog_program}(?:\[%{POSINT:syslog_pid}\])?: %{GREEDYDATA:syslog_message}" }
add_field => [ "received_at", "%{@timestamp}" ]
add_field => [ "received_from", "%{host}" ]
}
date {
match => [ "syslog_timestamp", "ISO8601" ]
remove_field => [ "syslog_timestamp" ]
}
mutate {
replace => [ "message", "%{syslog_message}" ]
remove_field => [ "syslog_message" ]
}
}
}
output {
elasticsearch { hosts => [
"elasticsearch.marathon.mesos:9200"
]
}
}
{
"zk": "zk://192.168.192.101:2181,192.168.192.102:2181,192.168.192.103:2181/mesos",
"masters": ["192.168.192.101:5050", "192.168.192.102:5050", "192.168.192.103:5050"],
"refreshSeconds": 60,
"ttl": 60,
"domain": "mesos",
"port": 53,
"resolvers": ["10.0.2.3"],
"timeout": 5,
"httpon": true,
"dnson": true,
"httpport": 8123,
"externalon": true,
"listener": "0.0.0.0",
"SOAMname": "ns1.mesos",
"SOARname": "root.ns1.mesos",
"SOARefresh": 60,
"SOARetry": 600,
"SOAExpire": 86400,
"SOAMinttl": 60,
"IPSources": ["netinfo", "mesos", "host"]
}