gpt4 book ai didi

logstash 简单文件输入/输出

转载 作者:行者123 更新时间:2023-12-05 03:11:34 30 4
gpt4 key购买 nike

我无法让 logstash 正常工作。 Basic logstash Example作品。但后来我与 Advanced Pipeline Example 作斗争.也许这也可能是 Elasticsearch 的问题。

现在我只想检查一个简单的示例是否有效:

  • 输入:读取文本文件-a
  • 输出:使用文本文件a的输入生成新的文本文件b

但我正在努力解决这个问题。我的配置如下:

# foo.conf
input {
file {
path => "C:/logstash-2.3.1/logstash-tutorial-dataset"
start_position => "beginning"
}
}
output {
stdout {}
file {
#message_format => "%{foo},%{bar},%{fii},%{bor},%{bing}"
#codec => { line { format => "custom format: %{message}"}}
path => "C:/output.txt"
}
}

当我运行 logstash 时,我收到以下响应,但没有任何反应。

bin/logstash -f foo.conf -v --debug --verbose
io/console not supported; tty will not be manipulated
{:timestamp=>"2016-04-22T13:41:15.514000+0200", :message=>"starting agent", :level=>:info}
{:timestamp=>"2016-04-22T13:41:15.518000+0200", :message=>"starting pipeline", :id=>"main", :level=>:info}
{:timestamp=>"2016-04-22T13:41:16.035000+0200", :message=>"Registering file input", :path=>["C:/logstash-2.3.1/logstash-tutorial-dataset"], :level=>:info}
{:timestamp=>"2016-04-22T13:41:16.039000+0200", :message=>"No sincedb_path set, generating one based on the file path", :sincedb_path=>"c:/Users/foobar/.sincedb_802dc9c88c8fad631bf3d3a5c96435e4", :path=>["C:/logstash-2.3.1/logstash-tutorial-dataset"], :level=>:info}
{:timestamp=>"2016-04-22T13:41:16.103000+0200", :message=>"Starting pipeline", :id=>"main", :pipeline_workers=>4, :batch_size=>125, :batch_delay=>5, :max_inflight=>500, :level=>:info}
{:timestamp=>"2016-04-22T13:41:16.106000+0200", :message=>"Pipeline main started"}

如何让这个简单的示例起作用?

最佳答案

ignore_older => 0 成功了,请参阅文档:ignore_older .

工作配置如下:

# foo.conf
input {
file {
path => "C:/logstash-2.3.1/logstash-tutorial-dataset"
start_position => "beginning"
ignore_older => 0
}
}
output {
stdout {}
file {
path => "C:/output.txt"
}
}

现在 .sincedb* 文件也包含内容。

关于logstash 简单文件输入/输出,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/36793035/

30 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com