port:
  tcp:5066:
    listening: true
    ip:
    - '127.0.0.1'

mount:
  /usr/share/metricbeat/metricbeat.yml:
    exists: true
    opts:
      - ro

user:
  metricbeat:
    exists: true
    uid: 1000
    gid: 1000

http:
  http://elasticsearch-master:9200/_cat/indices:
    status: 200
    timeout: 2000
    body:
      - 'metricbeat-7.10.3'

  'http://elasticsearch-master:9200/_search?q=metricset.name:state_container%20AND%20kubernetes.container.name:metricbeat':
    status: 200
    timeout: 2000
    body:
      - 'metricbeat-7.10.3'

file:
  /usr/share/metricbeat/metricbeat.yml:
    exists: true
    contains:
      - 'output.elasticsearch'
      - 'elasticsearch-master:9200'

command:
  cd /usr/share/metricbeat && metricbeat test output:
    exit-status: 0
    stdout:
      - 'elasticsearch: http://elasticsearch-master:9200'
      - 'version: 7.10.3'
