Pass Envt Variables to Logstash config file

Hello Team

I am having Logstash v7.8.0 installed along with Elasticsearch v7.8.0.

My Requirement is

  1. to run multiple logstash instances using pipelines via individual "conf" files.

  2. These conf files , are having variables which are unique across the executions and I need to set them before running logstash.

  3. My Logstash will run with the help of scheduler in interval of time period say 1 hour.

I am not able to achieve : to have variables set before scheduler hitting logstash to read "conf" file and run it.

I am using shell script to be executed before logstash runs.. but its not working.

How to run shell script via logstash pipeline so that , I can have variables in respective "conf" files only and multiple times as its a scheduler run throughout the day.

Thanks
Tushar Nemade

Try putting your env vars in /etc/default/logstash

Hello

I have configure logstash in my folder, its not rpm installation.

Could you please help me where i can save my variables in manual installation..

And do i need to same then in a file ? and what should be name and how to call it in execution..

Thanks
Tushar Nemade

Hello

I understand now , the file itself is /etc/default/logstash.

My another query is , if I am having dynamic variable values ,which are changing as per every 1 hour of duration .. and logstash is running multiple instances via its own input plugin -> elasticsearch --> scheduler ... making sure /etc/default/logstash file is updated with latest variable will be a challenge in non-ideal / error situation.

If there any way we can have shell script executed before logstash starts input / filter / output stuff from its conf file.

Thanks
Tushar Nemade

Hi

Can someone please help me..

Thanks
Tushar Nemade

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