How to save and retrieve usernames and passwords from logstash config

i need to get a password to connect to database using jdbc plugin. please let me know best vault method to use inside logstash config

jdbc_connection_string => "jdbc:db2://xxxxxxxxxxxxxx:port"
	jdbc_user => "username"
	jdbc_password => "@string??/variable"
	# or jdbc_password_filepath => "/path/to/my/password_file"

There's no support for a "vault method". The password needs to be stored in plain text, either in the config file or in the jdbc_password_filepath file.

1 Like

we need better solution.. :slight_smile:

Unknown setting 'jdbc_password_filepath' for jdbc {:level=>:error}

how eaxtly we need to save in the file.. just the password saved in the first line of the file?

i m getting error when i save in plain text and pointed them using the jdbc_password_filepath

Unknown setting 'jdbc_password_filepath' for jdbc {:level=>:error}

Do you have at least 4.0.2 of the jdbc input plugin? Check with the logstash-plugin command. Also, please show your current configuration.

how eaxtly we need to save in the file.. just the password saved in the first line of the file?

Yes.

i m getting error when i save in plain text and pointed them using the jdbc_password_filepath

What error do you get?

i have 3.0.2, and when i update, there is lot of dependencies. any easy way to update the below and install jdbc plugin to 4.0.2/latest?

  • logstash-core-plugin-api ~ depends on logstash-core
    -logstash-input-irc.. etc

It sounds like you're running Logstash 2.3 or earlier. In that case you need to upgrade.

can we update the logstash alone. If we update them to higher version, do I
need to update elastic search and kibana? I also checked if we can update
the Gemlist and bundle update. But I don't know I can do that.
However which version of logstash supports password on file ?

can we update the logstash alone. If we update them to higher version, do I need to update Elasticsearch and kibana?

No.

However which version of logstash supports password on file ?

I think you need 2.4 or later, but why run anything but the latest?

Looks like cookbook we use have been based on 2.3 version of logstash.I
don't know the impact if I change the logstash version to 5. So would like
to know for all

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.