Logstash - make input file path configurable

Hi guys,
Is it possible to pass the input file path from command line like a system variable or environmental variable and use it inside the logstash configuration in some way???

Thanks,
sam.

No, but you can

  • generate the Logstash configuration file or
  • pass configuration to Logstash via the -e startup option.

If you tell us more about what you want to achieve we might be able to give you a better answer.

Lets assume my logstash configuration to be

input {
file {
path => "/var/tmp/*"
}
}

i want the ability to pass /var/tmp/* in some manner say like replacement of a variable

input {
file {
path => "$TO_REPLACE"
}
}

and pass TO_REPLACE during start up like logstash -f config.conf -DTO_REPLACE="/var/tmp/*"

Thanks,
sam