logstash-plugins/logstash-output-elasticsearch

Support base64 encoded Api Key

jsvd opened this issue · 1 comments

jsvd commented

Currently logstash supports the api key in the form of "id:key":

input {
  elasticsearch {
    "api_key" => "TiNAGG4BaaMdaH1tRfuU:KnR6yE41RrSowb0kQ0HWoA" 
  }
}

However, the Elasticsearch output when creating an API Key is:

{
  "id" : "9tPacX4BGhtIQNIMawN9",
  "name" : "my-api-key",
  "api_key" : "hATekzVwRemmgCSxJXcWsw",
  "encoded" : "OXRQYWNYNEJHaHRJUU5JTWF3Tjk6aEFUZWt6VndSZW1tZ0NTeEpYY1dzdw=="
}

Which means a user must compose the "id:key" themselves. Using the encoded form would mean less copy pasting, less errors, and simpler experience.
For backwards compatibility sake we can still support the "id:key" format by detecting if the input has a ":". In this case we can skip the base64 encoding and use the input as is.

Hi, is there an update on this? We are trying to run logstash 8.8.1 in k8s which only supports secrets in the base64 format and we are now being forced to add an additional step to decode it. Same goes for cloud_id as well.