Use variable in logstash config

Hi
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 => "http://192.168.1.1:8086/query?pretty=true&q=SELECT+*+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?
Thanks

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