Environment variable interpolation in Logstash conf files


(Tyler Gregory) #1

We run logstash on k8s with centralized pipeline management, and I'm attempting to pass credentials into the containers as env vars. This has worked for everything but the azure_eventhubs input plugin. Debug logging seems to indicate that the SAS_KEY env var in this plugin:

azure_event_hubs {
      codec => "json"
      config_mode => "advanced"
      threads => 5
      decorate_events => true
      storage_connection => "DefaultEndpointsProtocol=https;AccountName=<account_name>;AccountKey=${STORAGE_KEY};EndpointSuffix=core.windows.net"
      event_hubs => [
        {"paas" => {
          event_hub_connection => "Endpoint=sb://<event_hub_namespace>.servicebus.windows.net/;SharedAccessKeyName=collector;SharedAccessKey=${SAS_KEY};EntityPath=paas"
          consumer_group => "logstash"
          storage_container => "azurelogscentralus-paas"
        }}
      ]
      add_field => {
        "[fields][logsource]" => "azure-paas"
      }
    }

is not interpolated, while the STORAGE_KEY var is. Does interpolation not go into nested structures like this?