【发布时间】:2015-06-29 05:52:17
【问题描述】:
请有人向我解释一下,为什么logstash一直忽略“编解码器=>普通=>格式”设置,我正在尝试设置?
我正在使用的 Cfg 文件:
input {
gelf {
host => "[some ip]"
port => 12201
}
}
output {
elasticsearch {
host => "[some ip]"
bind_port => "9301"
}
file {
codec => plain {
format => "%{[time]} | %{[severity]} : /%{[thread]}/ %{[loggername]} (%{[sourcemethodname]}) - %{[message]}"
}
path => "/Users/[some user]/logs/%{host}/%{facility}-%{+YYYY-MM-dd}.log"
}
}
我以为我使用了错误的格式,为字段尝试了不同的组合,例如“%{time}”,甚至尝试使用常量文本,例如:
codec => plain {format => "Simple line"}
但似乎没有任何效果。它很好地输出到 elasticsearch,创建文件夹/文件,但将其输出为 JSON。
如果有人知道这是怎么回事,请帮忙。 谢谢。
【问题讨论】: