我有存储在 json 文件中的测试结果。然后我让 logstash 找到该文件并尝试将所有行发送到 elasticsearch。只有大约一半的行被发送并且无法弄清楚为什么某些行被遗漏了。例如,将有 34 行,但只发送了 14 行。
input {
file {
path => "/data/*.json"
start_position => "beginning"
}
}
# ----------------------------------------------------------------------
filter {
# Parse fields out of JSON message, then remove the raw JSON.
json {
source => "message"
}
}
# ----------------------------------------------------------------------
output {
elasticsearch {
hosts => ["host:9200", "localhost:9200"]
index => "ct-%{+YYYY.MM.dd}"
}
stdout { codec => rubydebug }
我不确定json本身是否存在导致logstash跳过它的内容,或者我在上面发布的logstash.conf文件是否有问题。