Logstash - make input file path configurable


(Samnik60) #1

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.


(Magnus B├Ąck) #2

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.


(Samnik60) #3

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


(system) #4