首页 > 解决方案 > 如何将logstash与opensearch集成到logstash-output-opensearch

问题描述

我正在使用 logstash 和 AWS OpenSearch。我已经sudo apt-get install logstash在我的 logstash 服务器中安装了 logstash ( )。我已经创建了输入和输出文件。

Error
 { action=>LogStash::PipelineAction::Create/pipeline_id:main, exception=>"LogStash::PluginLoadingError", message=>"Couldn't find any output plugin named "opensearch"}

    input {
      file {
        path => "/dev/**/*"
        exclude => [ "access_log", "error_log" ]
        ignore_older => "2 d"
        start_position => "beginning"
        tags =>["dev"]
      }
     file {
        path => "/prod/**/*"
        exclude => [ "access_log", "error_log" ]
        ignore_older => "2 d"
        start_position => "beginning"
        tags =>["prod"]
      }
     
    }


    output {
    if "dev" in [tags]{
    opensearch {
          hosts => ["domainname"]
          index => "dev--%{+xxxx.ww}"
          region => "myregion"
          user => "****"
          password => "****"
          max_bulk_bytes => 9999999
      }
    }
    if "prod" in [tags]{
    opensearch {
          hosts => ["domain"]
          index => "dev--%{+xxxx.ww}"
          region => "myregion"
          user => "****"
          password => "****"
          max_bulk_bytes => 9999999
      }
    }
    }`

``


标签: amazon-web-serviceselasticsearchlogstashopensearch

解决方案


使用来自https://opensearch.org/downloads.html的 Logstash OSS ,而不是来自elastic.co

curl https://artifacts.opensearch.org/logstash/logstash-oss-with-opensearch-output-plugin-7.16.2-linux-x64.tar.gz -o logstash-oss-with-opensearch-output-plugin-7.16.2-linux-x64.tar.gz

tar -zxvf logstash-oss-with-opensearch-output-plugin-7.16.2-linux-x64.tar.gz

run logstash from ~/logstash-7.16.2/bin

推荐阅读