Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[BUG]: ilogtail连接es,加上tls配置后,启动失败 #1157

Closed
dxzxomy opened this issue Sep 25, 2023 · 1 comment · Fixed by #1174
Closed

[BUG]: ilogtail连接es,加上tls配置后,启动失败 #1157

dxzxomy opened this issue Sep 25, 2023 · 1 comment · Fixed by #1174
Labels
bug Something isn't working

Comments

@dxzxomy
Copy link

dxzxomy commented Sep 25, 2023

enable: true
inputs:
  - Type: file_log          # 文件输入类型
    LogPath: .              # 文件路径Glob匹配规则
    FilePattern: simple.log # 文件名Glob匹配规则
flushers:
  - Type: flusher_stdout    # 标准输出流输出类型
    OnlyStdout: true
  - Type: flusher_elasticsearch
    Addresses: 
      - https://elasticsearch-master:31474
    Index: default
    Authentication:
      PlainText:
        Username: elastic
        Password: STfQkJDAD0UejztI
      TLS:
        Enabled: true
        CAFile: /yinhe/apps/logtail/certs/ca.crt 
        CertFile: /yinhe/apps/logtail/certs/tls.crt
        KeyFile: /yinhe/apps/logtail/certs/tls.key
    HTTPConfig:
        MaxIdleConnsPerHost: 10
        ResponseHeaderTimeout: Second

2023/09/25 11:46:21 DEBUG Now using Go's stdlib log package (via loggers/mappers/stdlib).
load log config /yinhe/apps/logtail/plugin_logger.xml
recover stdout
recover stderr
panic: reflect: reflect.Value.Set using value obtained using unexported field

goroutine 17 [running, locked to thread]:
reflect.flag.mustBeAssignableSlow(0x7f9c5574191a?)
    /usr/local/go/src/reflect/value.go:257 +0xc5
reflect.flag.mustBeAssignable(...)
    /usr/local/go/src/reflect/value.go:247
reflect.Value.Set({0x7f9c55d51e40?, 0xc000514000?, 0x7f9c55746142?}, {0x7f9c55d51e40?, 0xc000514140?, 0x7f9c55d51e40?})
    /usr/local/go/src/reflect/value.go:2154 +0x6a
github.com/alibaba/ilogtail/plugins/flusher/elasticsearch.mergeTransports(0x7f9c55ba1ac0?, 0xc000525a10?)
    /src/plugins/flusher/elasticsearch/authentication.go:123 +0x470
github.com/alibaba/ilogtail/plugins/flusher/elasticsearch.configureHTTP(0xc000012e40, 0xc0001ed520?)
    /src/plugins/flusher/elasticsearch/authentication.go:104 +0xe9
github.com/alibaba/ilogtail/plugins/flusher/elasticsearch.(*Authentication).ConfigureAuthenticationAndHTTP(0xc0006c23b8?, 0xc000012e40, 0x7f9c559e2500?)
    /src/plugins/flusher/elasticsearch/authentication.go:55 +0x7f
github.com/alibaba/ilogtail/plugins/flusher/elasticsearch.(*FlusherElasticSearch).Init(0xc0006c2370, {0x7f9c561fed68?, 0xc00051a0a0?})
    /src/plugins/flusher/elasticsearch/flusher_elasticsearch.go:122 +0x1e5
github.com/alibaba/ilogtail/pluginmanager.loadFlusher({0xc0004e0e10, 0x15}, 0xc0003f2000, {0x7f9c55b9ff00, 0xc00037e1b0})
    /src/pluginmanager/logstore_config.go:762 +0x114
github.com/alibaba/ilogtail/pluginmanager.createLogstoreConfig({0x0, 0x0}, {0x0, 0x0}, {0xc000658c00, 0x40}, 0x0, {0x2ddf818, 0x376})
    /src/pluginmanager/logstore_config.go:598 +0x186b
github.com/alibaba/ilogtail/pluginmanager.LoadLogstoreConfig({0x0, 0x0}, {0x0, 0x0}, {0xc000658c00, 0x40}, 0xc0000780f0?, {0x2ddf818, 0x376})
    /src/pluginmanager/logstore_config.go:659 +0x18f
main.LoadConfig({0x1084578, 0x0}, {0x1084578, 0x0}, {0x2e06af8, 0x40}, 0xc0000e2000?, {0x2ddf818, 0x376})
    /src/plugin_main/plugin_export.go:109 +0x245
@PungYoung
Copy link

enable: true
inputs:
  - Type: file_log          # 文件输入类型
    LogPath: .              # 文件路径Glob匹配规则
    FilePattern: simple.log # 文件名Glob匹配规则
flushers:
  - Type: flusher_stdout    # 标准输出流输出类型
    OnlyStdout: true
  - Type: flusher_elasticsearch
    Addresses:
      - "https://172.18.0.2:9200"
    Index: log_%{+yyyyMMdd}
    Authentication:
      TLS:
        Enabled: true
        CAFile: /data/es/config/certs/http_ca.crt
      PlainText:
        Username: elastic
        Password: _n8ec=vl0ln*E1MnwW0T

这样配置没有问题

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants