【问题标题】:Fluentd unable to create index with ElasticsearchFluentd 无法使用 Elasticsearch 创建索引
【发布时间】:2019-08-27 08:56:40
【问题描述】:

我正在尝试将本地服务器日志从 Windows 转发到 linux 机器中的弹性搜索服务器,并在 kibana 中检查这些日志。这是目前的测试环境。两端的 fuentd 没有显示任何问题。但是在 kibana 中没有创建索引。不确定这里的问题是什么。请在下面找到两台服务器的配置文件。

还有一个问题是有什么方法可以知道转发的日志在#in 目标服务器中存储的位置。

注意:我在我的 Rhel 7.5 机器上配置了 Ruby 2.6.3。我已经通过 Gem 安装方法安装了 fluentd,还安装了与我当前的 elasticsearch 版本兼容的 fluentd-plugin-elasticsearch 3.5.5 和 elasticsearch 7.2.1 gems。

转发 Windows 服务器

    <source>
           @type tail
           tag server
           path C:\sw_logs\server.log 
           pos_file C:\opt\pos_files\server.log.pos
    <parse>
        @type json
    </parse>
    </source>
    <match server>a
        @type stdout
    </match>
    <match server>
        @type forward
        send_timeout 60s
    <server>
        host x.x.x.154
        port 24224
    </server>
    <buffer>
              retry_max_times 3
              retry_randomize false
              retry_max_interval 32s
              retry_timeout 1h
              path /var/log/fluentd/forward.log
     </buffer>
     </match>

聚合和 Elasticsearch 前向配置 Rhel 7.5

     <source>
               @type forward
               port 24224
      </source>
      <match server>
                @type copy
      <store>
                @type elasticsearch
                path /var/log/fluentd/forward.log
                host x.x.x.154
                port 9200
                logstash_format false
                index_name fluentd.${tag}.%Y%m%d
                type_name fluentd
                type_name "_doc"
                #New Change begin
                utc_index true
                #End new Change
                verify_es_version_at_startup false
                default_elasticsearch_version 7.x
                max_retry_get_es_version 1
                max_retry_putting_template 1
       <buffer>
                @type file
                path /var/log/ge_efk_logdata/buffer/win29.buffer/
       # Buffer Parameters
                flush_thread_count 3
                chunk_limit_size 16MB
                total_limit_size 4GB
                queue_limit_length
                chunk_full_threshold 0.85
                compress gzip
                retry_timeout
        # Flush Parameters
                flush_at_shutdown false
                #Assuming persistent buffers
                flush_mode immediate
                #flush_interval 60s
                flush_thread_count 2
                flush_thread_interval 1.0
                flush_thread_burst_interval 1.0
                delayed_commit_timeout 60s
                overflow_action throw_exception
        # Retry Parameters
                retry_timeout 1h
                retry_forever false
                retry_max_times 5
             </buffer>
        </store>
</match>

【问题讨论】:

    标签: elasticsearch fluentd


    【解决方案1】:

    能否分享一下fluentd和elasticsearch的日志,试试下面的配置:

    <match *.**>
      @type copy
        <store>
          @type elasticsearch
          host x.x.x.154
          port 9200
          include_tag_key true
          logstash_format true
          logstash_prefix fluentd
          flush_interval 10s
        </store>
    </match>
    

    【讨论】:

      猜你喜欢
      • 1970-01-01
      • 1970-01-01
      • 2020-03-20
      • 2016-01-19
      • 1970-01-01
      • 1970-01-01
      • 2021-07-10
      • 2020-05-31
      • 1970-01-01
      相关资源
      最近更新 更多