Use variable in logstash config

I have logstash input like below, how can i set variable for "cpu" (it is name of table in database) and it has different values like "mem, disk,i/o,...".
need to pass name of table as variable instead of define multi input. is it possible in logstash?

input {
  http_poller {
    urls => {
      test1 => {
        method => get
        url => "*+FROM+cpu%20WHERE%20time%20%3E%20now()%20-%201m&db=monitoringdb"
        headers => {
          Authorization => "Token "
    schedule => { cron => "* * * * * GMT"}
    request_timeout => 60
    codec => "json"
    metadata_target => "http_poller_metadata"


I believe you can reference an environment variable, but that requires a pipeline restart. You can also edit the configuration using a script and force a pipeline restart that way.

@Badger would you please tell me example?

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