【发布时间】:2018-01-16 19:34:08
【问题描述】:
我在 GCS 中有文件,每个文件都包含 json 行 文件示例:
{"msg": "hello world", "level": "info", "timestamp": "2017-09-01T00:00"}
{"msg": "some error", "level": "error", "timestamp": "2017-09-02T00:00"}
{"msg": "success" , "level": "info", "timestamp": "2017-09-03T00:00"}
...
我正在 GCS 中的所有文件上运行,下载每个文件并尝试将它们发送到 logstash - 所以我在弹性中获取每一行日志
这是我的logstash conf:
input {
tcp {
port => 5000
}
}
output {
elasticsearch {
hosts => "https://xxxxxxxxxxx.us-central1.gcp.cloud.es.io:9243"
user => "elastic"
password => "xxxxxxx"
index => "app-log-%{+YYYY.MM.dd}"
}
}
现在如何将文件内容发送到logstash? 我应该使用与 tcp 不同的输入吗?也许文件节拍? 是否有任何 nodejs(或其他语言)的演示代码来发送文件?
【问题讨论】:
标签: logstash