Read jdbc password from shell script output


(Rons1404) #1

Hey,
Is it possible to set jdbc_password as output of some script?
I want to read the password from a global variable, but it's encrypted so I need to call some shell script to decrypt it. The only option I see is to extend the built-in jdbc plugin, is there another way?


(Pjanzen) #2

This might help

https://www.elastic.co/guide/en/logstash/current/environment-variables.html


(Rons1404) #3

Thanks for the response, I checked your link and mutate doesn't solve my issue.
I need to run a shell script from within the Logstash and save the return value of that script into a variable.


(Pjanzen) #4

I am do not know which version of logstash you are using but you could edit the file: /etc/systemd/system/logstash.service
There is a line that reads:
ExecStart=/usr/share/logstash/bin/logstash "--path.settings" "/etc/logstash"
You could add:
export JDBC_PASSWORD=<decrypt you password command>; usr/share/logstash/bin/logstash "--path.settings" "/etc/logstash"

It just might do the trick.


(system) #5

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