{
  "$schema" : "https://json-schema.org/draft/2020-12/schema",
  "type" : "object",
  "properties" : {
    "timestamp" : {
      "type" : "string",
      "format" : "date-time",
      "x-isAttributed" : false,
      "description" : "The timestamp when the event originally occurred"
    },
    "direction" : {
      "type" : "string",
      "enum" : [ "INBOUND", "OUTBOUND", "INTERNAL", "UNKNOWN" ],
      "x-isAttributed" : false,
      "description" : "The direction of the network flow (for example, INTERNAL)"
    },
    "source_user" : {
      "type" : "string",
      "x-isAttributed" : true,
      "description" : "Name of the source user involved in the flow"
    },
    "source_asset" : {
      "type" : "string",
      "x-isAttributed" : true,
      "description" : "Name of the source asset involved in the flow"
    },
    "source_address" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "IP address of the source",
      "oneOf" : [ {
        "format" : "ipv4"
      }, {
        "format" : "ipv6"
      }, {
        "format" : "hostname"
      } ]
    },
    "source_port" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Port number used by the source",
      "pattern" : "\\d+"
    },
    "destination_user" : {
      "type" : "string",
      "x-isAttributed" : true,
      "description" : "Name of the destination user involved in the flow"
    },
    "destination_asset" : {
      "type" : "string",
      "x-isAttributed" : true,
      "description" : "Name of the destination asset involved in the flow"
    },
    "destination_address" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "IP address of the destination",
      "oneOf" : [ {
        "format" : "ipv4"
      }, {
        "format" : "ipv6"
      }, {
        "format" : "hostname"
      } ]
    },
    "destination_port" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Port number used by the destination",
      "pattern" : "\\d+"
    },
    "geoip_city" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The city name of the source IP address"
    },
    "geoip_country_code" : {
      "type" : "string",
      "x-isAttributed" : false,
      "pattern" : "[A-Z]{2}",
      "description" : "Two-character ISO 3166-1 country code for the source IP address"
    },
    "geoip_country_name" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The country name of the source IP address"
    },
    "geoip_organization" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The organization name attributed from source IP address"
    },
    "geoip_region" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The region name of the source IP address"
    },
    "transport_protocol" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Transport protocol used in the flow (for example, TCP, UDP)"
    },
    "app_protocol" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Application-level protocols used in the flow"
    },
    "app_protocol_description" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Description of the application protocol"
    },
    "app_protocol_category" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Category of the application protocol"
    },
    "community_id" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Identifier representing the flow's community ID"
    },
    "total_bytes" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Total number of bytes transferred in the flow",
      "pattern" : "\\d+"
    },
    "total_packet_count" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Total number of packets transferred in the flow",
      "pattern" : "\\d+"
    },
    "source_bytes" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Number of bytes sent from the source",
      "pattern" : "\\d+"
    },
    "source_packet_count" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Number of packets sent from the source",
      "pattern" : "\\d+"
    },
    "destination_bytes" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Number of bytes sent to the destination",
      "pattern" : "\\d+"
    },
    "destination_packet_count" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Number of packets sent to the destination",
      "pattern" : "\\d+"
    },
    "flow_initiated" : {
      "type" : "string",
      "format" : "date-time",
      "x-isAttributed" : false,
      "description" : "Timestamp when the network flow began"
    },
    "first_packet_time" : {
      "type" : "string",
      "format" : "date-time",
      "x-isAttributed" : false,
      "description" : "Timestamp of the first observed packet"
    },
    "last_packet_time" : {
      "type" : "string",
      "format" : "date-time",
      "x-isAttributed" : false,
      "description" : "Timestamp of the last observed packet"
    },
    "r7_context" : {
      "type" : "object",
      "properties" : {
        "source_user" : {
          "type" : "object",
          "properties" : {
            "domain" : {
              "type" : "string",
              "x-isAttributed" : false,
              "format" : "hostname",
              "description" : "The domain of the user"
            },
            "name" : {
              "type" : "string",
              "x-isAttributed" : false,
              "description" : "The name of the r7context resource"
            },
            "rrn" : {
              "type" : "string",
              "x-isAttributed" : false,
              "description" : "The RRN (Rapid7 Resource Name) of the r7context resource",
              "pattern" : "rrn(_[^\\s:]+)?:[^\\s:]+:[^\\s:]*:[^\\s:]*(:[^\\s:]+)+"
            },
            "type" : {
              "type" : "string",
              "x-isAttributed" : false,
              "description" : "The type of r7context field",
              "const" : "user"
            }
          },
          "required" : [ "name", "rrn", "type" ],
          "x-isAttributed" : true
        },
        "destination_user" : {
          "type" : "object",
          "properties" : {
            "domain" : {
              "type" : "string",
              "x-isAttributed" : false,
              "format" : "hostname",
              "description" : "The domain of the user"
            },
            "name" : {
              "type" : "string",
              "x-isAttributed" : false,
              "description" : "The name of the r7context resource"
            },
            "rrn" : {
              "type" : "string",
              "x-isAttributed" : false,
              "description" : "The RRN (Rapid7 Resource Name) of the r7context resource",
              "pattern" : "rrn(_[^\\s:]+)?:[^\\s:]+:[^\\s:]*:[^\\s:]*(:[^\\s:]+)+"
            },
            "type" : {
              "type" : "string",
              "x-isAttributed" : false,
              "description" : "The type of r7context field",
              "const" : "user"
            }
          },
          "required" : [ "name", "rrn", "type" ],
          "x-isAttributed" : true
        },
        "source_asset" : {
          "type" : "object",
          "properties" : {
            "name" : {
              "type" : "string",
              "x-isAttributed" : false,
              "description" : "The name of the r7context resource"
            },
            "rrn" : {
              "type" : "string",
              "x-isAttributed" : false,
              "description" : "The RRN (Rapid7 Resource Name) of the r7context resource",
              "pattern" : "rrn(_[^\\s:]+)?:[^\\s:]+:[^\\s:]*:[^\\s:]*(:[^\\s:]+)+"
            },
            "type" : {
              "type" : "string",
              "x-isAttributed" : false,
              "description" : "The type of r7context field",
              "const" : "asset"
            }
          },
          "required" : [ "name", "rrn", "type" ],
          "x-isAttributed" : true
        },
        "destination_asset" : {
          "type" : "object",
          "properties" : {
            "name" : {
              "type" : "string",
              "x-isAttributed" : false,
              "description" : "The name of the r7context resource"
            },
            "rrn" : {
              "type" : "string",
              "x-isAttributed" : false,
              "description" : "The RRN (Rapid7 Resource Name) of the r7context resource",
              "pattern" : "rrn(_[^\\s:]+)?:[^\\s:]+:[^\\s:]*:[^\\s:]*(:[^\\s:]+)+"
            },
            "type" : {
              "type" : "string",
              "x-isAttributed" : false,
              "description" : "The type of r7context field",
              "const" : "asset"
            }
          },
          "required" : [ "name", "rrn", "type" ],
          "x-isAttributed" : true
        }
      },
      "x-isAttributed" : true,
      "description" : "R7_context includes attributed information related to the entry, with references to Rapid7-specific RRNs"
    },
    "entry_id" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Unique Entry ID assigned to each document or log entry"
    },
    "custom_data" : {
      "type" : "object",
      "x-isAttributed" : false,
      "description" : "JSON string produced by applying one or more user-defined custom parsers to the original data"
    },
    "source_data" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The unparsed, original log line as received from the collector"
    },
    "source_json" : {
      "type" : "object",
      "x-isAttributed" : false,
      "description" : "The data that was received or collected by our collector or endpoint agent, formatted as JSON"
    }
  },
  "required" : [ "timestamp", "direction", "source_address", "source_port", "destination_address", "destination_port", "community_id", "total_bytes", "total_packet_count", "source_bytes", "source_packet_count", "destination_bytes", "destination_packet_count", "flow_initiated" ],
  "description" : "Network flow"
}