Skip to content

is https supported? #12

Description

@foxgst

The output config is

Output:
    ElasticSearch:
      Hosts:
        - https://127.0.0.1:9200
      Index: "{.event}-{{yyyy-MM-dd}}"
      Username: elastic
      Password: XXXXXXYYYYYY

and i get

➜  stash git:(master) ✗ ./stash -f etc/config.yaml                                 
2022/04/17 01:28:31 stash.go:58 health check timeout: Head "https://127.0.0.1:9200": x509: “Elasticsearch security auto-configuration HTTP CA” certificate is not trusted: no Elasticsearch node available
2022/04/17 01:28:31 {"@timestamp":"2022-04-17T01:28:31.581+08:00","level":"fatal","content":"stash.go:58 health check timeout: Head \"https://127.0.0.1:9200\": x509: “Elasticsearch security auto-configuration HTTP CA” certificate is not trusted: no Elasticsearch node available"}

the official guide is

➜  es curl --cacert http_ca.crt -u elastic https://127.0.0.1:9200            
Enter host password for user 'elastic':
{
  "name" : "34bb1b121a60",
  "cluster_name" : "docker-cluster",
  "cluster_uuid" : "Y4pyYI5rSg-JzEVphE8ZqA",
  "version" : {
    "number" : "8.1.2",
    "build_flavor" : "default",
    "build_type" : "docker",
    "build_hash" : "31df9689e80bad366ac20176aa7f2371ea5eb4c1",
    "build_date" : "2022-03-29T21:18:59.991429448Z",
    "build_snapshot" : false,
    "lucene_version" : "9.0.0",
    "minimum_wire_compatibility_version" : "7.17.0",
    "minimum_index_compatibility_version" : "7.0.0"
  },
  "tagline" : "You Know, for Search"
}

The ca cert which named http_ca.crt is copied from the docker container.

for go-stash is a competitor to logstash, i find filebeat and logstash's configuration from kibana.

output.elasticsearch:
  hosts: ["<es_url>"]
  username: "elastic"
  password: "<password>"
  # If using Elasticsearch's default certificate 
  ssl.ca_trusted_fingerprint: "<es cert fingerprint>" 
setup.kibana:
  host: "<kibana_url>"

there is a property named "ssl.ca_trusted_fingerprint", maybe helpful ?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions