我正在尝试从Elasticsearch中的/var/log/wtmp
读取访问日志
使用last -F /var/log/wtmp
登录框时,我可以读取文件
我正在运行logstash,并将日志发送到elasticsearch,这是logstash conf文件。
input {
file {
path => "/var/log/wtmp"
start_position => "beginning"
}
}
output {
elasticsearch {
host => localhost
protocol => "http"
port => "9200"
}
}
elasticsearch中显示的是
G
最佳答案
一旦我使用less打开文件,我只能看到二进制数据。
现在logstash无法理解此数据。
如下所示的logstash文件应该可以正常工作-
input {
pipe {
command => "/usr/bin/last -f /var/log/wtmp"
}
}
output {
elasticsearch {
host => localhost
protocol => "http"
port => "9200"
}
}
关于elasticsearch - 如何在Elasticsearch中读取/var/log/wtmp日志,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/33544655/