Search code examples
elasticsearchlogstashkibana

How to mention certificate in logstash/eck on kubernetes


By using the operator i install elastic search and kibana its working fine but in the logstash file ssl_certificate_authorities I am confused about How to get and how to mention because by default self-sign certificates are created inside the pod


Solution

  • Firstly, you should add enviroment logstash pod configuration file and then you can use this certificate in logstash output plugin. You can examine this question and answer.

    For the get ssl certificate from elastic secret, you can run below command:

    kubectl get secret yourclustername-es-http-certs-public -o go-template='{{index .data "tls.crt" | base64decode }}'
    

    You copy and paste ca.pem file and run below command for fingerprint:

    openssl x509 -fingerprint -sha256 -in ca.pem -noout | sed --expression 's/://g'
    

    Output like this:

    sha256 Fingerprint=2650CEEBBEC0D26D9EE9D9DE65T865607A37BFB3C42A5C0301CDC9E5DACCDEF9
    

    You can use this fingerprint as value of environment variable in logstash configuration file.