{
  "$schema" : "https://json-schema.org/draft/2020-12/schema",
  "$defs" : {
    "R7ContextAccountJsonBean" : {
      "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",
          "enum" : [ "account", "asset:account" ]
        }
      },
      "required" : [ "name", "rrn", "type" ]
    },
    "R7ContextAssetJsonBean" : {
      "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" ]
    },
    "R7ContextUserJsonBean" : {
      "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" ]
    }
  },
  "type" : "object",
  "properties" : {
    "timestamp" : {
      "type" : "string",
      "format" : "date-time",
      "x-isAttributed" : false,
      "description" : "The timestamp when the event originally occurred"
    },
    "type" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Type of the activity taken"
    },
    "product" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The programmatic reference to the product that generated the alert"
    },
    "severity" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Indicates the severity of the activity like whether it is a warn, error or info log"
    },
    "description" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The description of the activity if present"
    },
    "public_ip" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The public accessible IP associated with the activity",
      "oneOf" : [ {
        "format" : "ipv4"
      }, {
        "format" : "ipv6"
      } ]
    },
    "geoip_city" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The city name of the public IP address"
    },
    "geoip_country_code" : {
      "type" : "string",
      "x-isAttributed" : false,
      "pattern" : "[A-Z]{2}",
      "description" : "Two-character ISO 3166-1 country code for the public IP address"
    },
    "geoip_country_name" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The country name of the public IP address"
    },
    "geoip_organization" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The organization name attributed from public IP address"
    },
    "geoip_region" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The region name of the public IP address"
    },
    "user" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The single user associated with the activity"
    },
    "users" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      },
      "x-isAttributed" : false,
      "description" : "Two or more users associated with the activity"
    },
    "account" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The single account associated with the activity"
    },
    "accounts" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      },
      "x-isAttributed" : false,
      "description" : "Two or more accounts associated with the activity"
    },
    "hostnames" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "Two or more hostnames associated with the activity"
    },
    "asset" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The single asset associated with the activity"
    },
    "assets" : {
      "type" : "array",
      "items" : {
        "type" : "string"
      },
      "x-isAttributed" : false,
      "description" : "Two or more assets associated with the activity"
    },
    "internal_ip" : {
      "type" : "string",
      "x-isAttributed" : false,
      "description" : "The internal IP associated with the activity",
      "oneOf" : [ {
        "format" : "ipv4"
      }, {
        "format" : "ipv6"
      } ]
    },
    "source_json" : {
      "type" : "object",
      "x-isAttributed" : false,
      "description" : "The data that was received or collected by our collector or endpoint agent, formatted as JSON"
    },
    "r7_context" : {
      "type" : "object",
      "properties" : {
        "users" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/$defs/R7ContextUserJsonBean"
          },
          "x-isAttributed" : true
        },
        "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
        },
        "accounts" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/$defs/R7ContextAccountJsonBean"
          },
          "x-isAttributed" : true
        },
        "account" : {
          "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",
              "enum" : [ "account", "asset:account" ]
            }
          },
          "required" : [ "name", "rrn", "type" ],
          "x-isAttributed" : true
        },
        "assets" : {
          "type" : "array",
          "items" : {
            "$ref" : "#/$defs/R7ContextAssetJsonBean"
          },
          "x-isAttributed" : true
        },
        "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"
    }
  },
  "required" : [ "timestamp", "product" ],
  "description" : "General admin activity event"
}