databases:
  - name: "My IPv4 GeoIP DB"
    mmdb:
      ipVersion: 4 # Note: IPv4 mmdb can only hold IPv4.
      recordSize: 24 # One of 24, 28, 32. Start small, increase if it fails.
    types: # Best to always use the same established keys as MaxMind.
      "country.iso_code": string
      "autonomous_system_organization": string
      "autonomous_system_number": uint32
    inputs: # Source data and their mapping.
      # Inputs are processed as listed. Earlier entries are overwritten by later entries.
      - file: "data/geolite2-country-ipv4.csv"
        fields: ["from", "to", "country.iso_code"]
      - file: "data/geolite2-asn-ipv4.csv"
        fields: ["from", "to", "autonomous_system_number", "autonomous_system_organization"]
    output: data/geoip-v4.mmdb
    optimize:
      floatDecimals: 2 # Limit floats (eg. coordinates) to decimals for smaller DB size. (0=off, set to -1 to no decimals)
      forceIPVersion: true # Check IPs and discard IPs with the wrong version. (IPv4 and live in IPv6 mmdb)
      maxPrefix: 0 # Remove any network prefixes greater than maxPrefix for smaller DB size. (0=off)
    merge:
      conditionalResets: # Reset set of top level entries if another set is changed.
        # Reset the location entry when the country is changed.
        # If the new entry also has a location, it is kept, but a different country without location resets the location.
        - ifChanged: ["country"]
          reset: ["location"]

  # - name: "My IPv6 GeoIP DB"
  #   mmdb:
  #     ipVersion: 6 # Note: IPv6 mmdb can also hold IPv4.
  #     recordSize: 24 # One of 24, 28, 32. Start small, increase if it fails.
  #   types: # Best to always use the same established keys as MaxMind.
  #     "country.iso_code": string
  #     "autonomous_system_organization": string
  #     "autonomous_system_number": uint32
  #   inputs: # Source data and their mapping.
  #     # Inputs are processed as listed. Earlier entries are overwritten by later entries.
  #     - file: "input/iptoasn-asn-ipv6.csv"
  #       fields: ["from", "to", "autonomous_system_number", "autonomous_system_organization"]
  #     - file: "input/geo-whois-asn-country-ipv6.csv"
  #       fields: ["from", "to", "country.iso_code"]
  #   output: output/geoip-v6.mmdb
  #   optimize:
  #     floatDecimals: 2 # Limit floats (eg. coordinates) to decimals for smaller DB size. (0=off, set to -1 to no decimals)
  #     forceIPVersion: true # Check IPs and discard IPs with the wrong version. (IPv4 and live in IPv6 mmdb)
  #     maxPrefix: 0 # Remove any network prefixes greater than maxPrefix for smaller DB size. (0=off)
  #   merge:
  #     conditionalResets: # Reset set of top level entries if another set is changed.
  #       # Reset the location entry when the country is changed.
  #       # If the new entry also has a location, it is kept, but a different country without location resets the location.
  #       - ifChanged: ["country"]
  #         reset: ["location"]
