#定义了日志收集的来源,可以有tcp、udp、tail(文件)、forward(tcp+udp)、http等方式。 #定义对原始数据的解析方式,可以将日志转化为JSON。 @type tcp @id debug-input port 4560 tag info @type json #可以对收集的日志进行一系列的处理,比如说将日志打印到控制台或者对日志进行解析。 @type stdout #定义了收集到的日志最后输出到哪里,可以输出到stdout(控制台)、file、elasticsearch、mongo等里面。 @type stdout output_type json #使用elasticsearch来存储日志信息 @type elasticsearch host elasticsearch port 9200 type_name docker logstash_format true logstash_prefix happy-${tag}-logs logstash_dateformat %Y-%m-%d flush_interval 5s include_tag_key true