Skip to content

Support base64 encoded Api Key #1064

Open
@jsvd

Description

@jsvd

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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions