I try to get heartbeat with aws_elb autodiscovery to work. Though I'm able to get data visible in kibana, it is always a single listener from a single lb. Whereas I have 3 lb setup and it logs that it fetched 16 listeners.
I tried all kinds of configs with conditions without conditions etc etc. But I keep running into the scenario that autodiscovery logs only one start event.
heartbeat.autodiscover:
  providers:
  - type: aws_elb
    period: 5m
    regions: ["eu-west-1"]
    templates:
    - condition:
       equals.port: 3000
      config:
      - type: tcp
        name: "${data.host}:${data.port}"       
        hosts: ["${data.host}:${data.port}"]
        schedule: "@every 5s"
        timeout: 1s
    - condition:
       equals.port: 5601
      config:
      - type: http
        hosts: ["${data.host}:${data.port}"]
        schedule: "@every 5s"
        timeout: 1s
Whatever conditions I add or remove the only listener for which heartbeat is registering events is the last listener from the last lb when I output the data via the was cli. In my case port 3000.
If anyone knows what is going wrong in my setup, please enlighten me.
Logs showing single listener start event
Jan 07 15:55:12 ip-172-24-25-17 heartbeat[4167]: 2022-01-07T15:55:12.082+0100        DEBUG        [autodiscover]        autodiscover/autodiscover.go:172        Got a start event.        {"autodiscover.event": {"aws":{"elb":{"availability_zones":["eu-west-1c","eu-west-1a","eu-west-1b"],"created":"2022-01-07T08:18:41.43Z","host":"internal-elk7-t-cg-a-stage-client-alb-306711211.eu-west-1.elb.amazonaws.com","ip_address_type":"ipv4","listener_arn":"arn:aws:elasticloadbalancing:eu-west-1:807891339983:listener/app/elk7-t-cg-a-stage-client-alb/1727709932621845/e87d83211f006b90","load_balancer_arn":"arn:aws:elasticloadbalancing:eu-west-1:807891339983:loadbalancer/app/elk7-t-cg-a-stage-client-alb/1727709932621845","port":3000,"protocol":"HTTP","scheme":"internal","security_groups":["sg-0e28a298b7f1d3a33"],"ssl_policy":null,"state":{"code":"active"},"type":"application","vpc_id":"vpc-4fac482b"}},"cloud":{"availability_zone":["eu-west-1c","eu-west-1a","eu-west-1b"],"provider":"aws","region":"eu-west-"},"config":[{}],"host":"internal-elk7-t-cg-a-stage-client-alb-306711211.eu-west-1.elb.amazonaws.com","id":"arn:aws:elasticloadbalancing:eu-west-1:807891339983:listener/app/elk7-t-cg-a-stage-client-alb/1727709932621845/e87d83211f006b90","meta":{"aws":{"elb":{"availability_zones":["eu-west-1c","eu-west-1a","eu-west-1b"],"created":"2022-01-07T08:18:41.43Z","host":"internal-elk7-t-cg-a-stage-client-alb-306711211.eu-west-1.elb.amazonaws.com","ip_address_type":"ipv4","listener_arn":"arn:aws:elasticloadbalancing:eu-west-1:807891339983:listener/app/elk7-t-cg-a-stage-client-alb/1727709932621845/e87d83211f006b90","load_balancer_arn":"arn:aws:elasticloadbalancing:eu-west-1:807891339983:loadbalancer/app/elk7-t-cg-a-stage-client-alb/1727709932621845","port":3000,"protocol":"HTTP","scheme":"internal","security_groups":["sg-0e28a298b7f1d3a33"],"ssl_policy":null,"state":{"code":"active"},"type":"application","vpc_id":"vpc-4fac482b"}},"cloud":{"availability_zone":["eu-west-1c","eu-west-1a","eu-west-1b"],"provider":"aws","region":"eu-west-"}},"port":3000,"provider":"c2f082a2-f2c9-4544-814f-26d6558f1b04","start":true}}
Jan 07 15:55:12 ip-172-24-25-17 heartbeat[4167]: 2022-01-07T15:55:12.082+0100        DEBUG        [autodiscover]        autodiscover/autodiscover.go:193        Generated config: {
Jan 07 15:55:12 ip-172-24-25-17 heartbeat[4167]:   "hosts": [
Jan 07 15:55:12 ip-172-24-25-17 heartbeat[4167]:     "xxxxx"
Jan 07 15:55:12 ip-172-24-25-17 heartbeat[4167]:   ],
Jan 07 15:55:12 ip-172-24-25-17 heartbeat[4167]:   "name": "internal-elk7-t-cg-a-stage-client-alb-306711211.eu-west-1.elb.amazonaws.com:3000",
Jan 07 15:55:12 ip-172-24-25-17 heartbeat[4167]:   "schedule": "@every 5s",
Jan 07 15:55:12 ip-172-24-25-17 heartbeat[4167]:   "timeout": "1s",
Jan 07 15:55:12 ip-172-24-25-17 heartbeat[4167]:   "type": "tcp"
Jan 07 15:55:12 ip-172-24-25-17 heartbeat[4167]: }