【问题标题】:Logstash creates pipeline but index is not createdLogstash 创建管道但未创建索引
【发布时间】:2023-03-15 13:12:01
【问题描述】:

我正在尝试使用 json 文件在弹性搜索云上创建索引。我创建了如下配置:

input {
        file {
                path => ["/root/leads.json"]
                start_position => "beginning"
                ignore_older => 0
        }
}
output {
        elasticsearch {
                        hosts => ["https://ac9xxxxxxxxxxxxxb.us-east-1.aws.found.io:9243"]
                        user => "elastic"
                        password => "xxxxxxxxxxxxxx"
        }
}

我可以使用以下命令运行 logstash:

sudo bin/logstash -f /etc/logstash/conf.d/logstash.conf

logstash 启动了一个管道,但我没有看到在 elasticsearch 中创建任何索引:

 [INFO ] 2018-11-14 09:16:01.821 [[main]>worker1] file - No sincedb_path set, generating one based on the "path" setting {:sincedb_path=>"/usr/share/logstash/data/plugins/inputs/file/.sincedb_43b5fa3acfcfc04b3df80a7c15c8d991", :path=>["/root/leads.json"]}
[INFO ] 2018-11-14 09:16:01.852 [Converge PipelineAction::Create<main>] pipeline - Pipeline started successfully {:pipeline_id=>"main", :thread=>"#<Thread:0x2fda8150 run>"}
[INFO ] 2018-11-14 09:16:01.944 [Ruby-0-Thread-1: /usr/share/logstash/lib/bootstrap/environment.rb:6] agent - Pipelines running {:count=>1, :running_pipelines=>[:main], :non_running_pipelines=>[]}
[INFO ] 2018-11-14 09:16:01.996 [[main]<file] observingtail - START, creating Discoverer, Watch with file and sincedb collections
[INFO ] 2018-11-14 09:16:02.522 [Api Webserver] agent - Successfully started Logstash API endpoint {:port=>9600}

【问题讨论】:

  • 你能在file 输入中添加sincedb_path =&gt; "/dev/null" 吗?
  • @Val 我已经尝试过了.. 不工作并且显示相同的输出
  • 嗯,我会删除 ignore_older,不过,这可能会更好;-)
  • @Val 这确实有效,非常感谢 :)
  • 我能知道确切的原因吗​​?

标签: elasticsearch logstash kibana


【解决方案1】:

你应该像这样改变你的配置:

input {
        file {
                path => ["/root/leads.json"]
                start_position => "beginning"
                sincedb_path => "/dev/null"
        }
}

删除ignore_older =&gt; 0,因为这将有效地忽略早于 0 秒的文件 :-) 添加sincedb_path 可确保您可以从文件开头多次运行管道。

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 2015-11-15
    • 1970-01-01
    • 2015-05-27
    • 1970-01-01
    • 2019-05-24
    • 1970-01-01
    • 2021-01-16
    • 1970-01-01
    相关资源
    最近更新 更多