zabbix_export:
  version: '8.0'
  host_groups:
    - uuid: f2481361f99448eea617b7b1d4765566
      name: 'Discovered hosts'
  hosts:
    - host: my_pc_vms
      name: my_pc_vms
      groups:
        - name: 'Discovered hosts'
      discovery_rules:
        - name: Service
          type: NESTED
          key: 'lld_trap[{#VM}]'
          item_prototypes:
            - name: 'Service {#SERVICE} {#VM}'
              type: TRAP
              key: 'nested_itemp_prototype[{#VM},{#SERVICE}]'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.vm_data[0].{#SERVICE}'
            - name: 'Service {#SERVICE} state'
              type: TRAP
              key: 'state[{#VM},{#SERVICE}]'
              preprocessing:
                - type: JSONPATH
                  parameters:
                    - '$.vm_data[0].{#SERVICE}'
          parent_discovery_rule:
            key: trap
          lld_macro_paths:
            - lld_macro: '{#SERVICE}'
              path: '$.{#VM}'
          preprocessing:
            - type: JSONPATH
              parameters:
                - $.vm_data
          overrides:
            - name: 'item prototype override'
              step: '1'
              filter:
                conditions:
                  - macro: '{#SERVICE}'
                    value: Postgres
                    operator: NOT_MATCHES_REGEX
              operations:
                - operator: NOT_LIKE
                  value: '{#VM}'
                  tags:
                    - tag: service
                      value: state
        - name: VM
          type: TRAP
          key: trap
          lld_macro_paths:
            - lld_macro: '{#VM}'
              path: $.vm_name
