- key: ecs
  title: ECS
  description: >
    ECS fields.
  fields:
    
    - name: agent
      title: Agent
      group: 2
      description: >
        The agent fields contain the data about the software entity, if any, that collects, detects, or observes events on a host, or takes measurements on a host. Examples include Beats. Agents may also run on observers. ECS agent.* fields shall be populated with details of the agent running on the host or observer where the event happened or the measurement was taken.
      footnote: >
        Examples: In the case of Beats for logs, the agent.name is filebeat. For APM, it is the
        agent running in the app/service. The agent information does not change if
        data is sent through queuing systems like Kafka, Redis, or processing systems
        such as Logstash or APM Server.
      type: group
      fields:
    
        - name: version
          level: core
          type: keyword
          description: >
            Version of the agent.
    
          example: 6.0.0-rc2
    
        - name: name
          level: core
          type: keyword
          description: >
            Name of the agent.
    
            This is a name that can be given to an agent. This can be helpful if
            for example two Filebeat instances are running on the same host
            but a human readable separation is needed on which Filebeat instance
            data is coming from.
    
            If no name is given, the name is often left empty.
          example: foo
    
        - name: type
          level: core
          type: keyword
          description: >
            Type of the agent.
    
            The agent type stays always the same and should be given by the agent used.
            In case of Filebeat the agent would always be Filebeat also if two
            Filebeat instances are run on the same machine.
          example: filebeat
    
        - name: id
          level: core
          type: keyword
          description: >
            Unique identifier of this agent (if one exists).
    
            Example: For Beats this would be beat.id.
          example: 8a4f500d
    
        - name: ephemeral_id
          level: extended
          type: keyword
          description: >
            Ephemeral identifier of this agent (if one exists).
    
            This id normally changes across restarts, but `agent.id` does not.
          example: 8a4f500f
    
    - name: base
      title: Base
      group: 1
      description: >
        The base set contains all fields which are on the top level. These fields are common across all types of events.
      type: group
      fields:
        - name: "@timestamp"
          type: date
          level: core
          required: true
          example: "2016-05-23T08:05:34.853Z"
          description: >
            Date/time when the event originated.
    
            For log events this is the date/time when the event was generated, and
            not when it was read.
    
            Required field for all events.
    
        - name: tags
          level: core
          type: keyword
          example: "[\"production\", \"env2\"]"
          description: >
            List of keywords used to tag each event.
    
        - name: labels
          level: core
          type: object
          example: {env: production, application: foo-bar}
          description: >
            Key/value pairs.
    
            Can be used to add meta information to events. Should not contain nested
            objects. All values are stored as keyword.
    
            Example: `docker` and `k8s` labels.
    
        - name: message
          level: core
          type: text
          example: "Hello World"
          description: >
            For log events the message field contains the log message.
    
            In other use cases the message field can be used to concatenate
            different values which are then freely searchable. If multiple
            messages exist, they can be combined into one message.
    
    - name: client
      title: Client
      group: 2
      description: >
        A client is defined as the initiator of a network connection for events regarding sessions, connections, or bidirectional flow records. For TCP events, the client is the initiator of the TCP connection that sends the SYN packet(s). For other protocols, the client is generally the initiator or requestor in the network transaction. Some systems use the term "originator" to refer the client in TCP connections. The client fields describe details about the system acting as the client in the network event. Client fields are usually populated in conjuction with server fields.  Client fields are generally not populated for packet-level events. 
      type: group
      fields:
    
        - name: ip
          level: core
          type: ip
          description: >
            IP address of the client.
    
            Can be one or multiple IPv4 or IPv6 addresses.
    
        - name: port
          level: core
          type: long
          description: >
            Port of the client.
    
        - name: mac
          level: core
          type: keyword
          description: >
            MAC address of the client.
    
        - name: domain
          level: core
          type: keyword
          description: >
            Client domain.
    
        # Metrics
        - name: bytes
          level: core
          type: long
          example: 184
          description: >
            Bytes sent from the client to the server.
    
        - name: packets
          level: core
          type: long
          example: 12
          description: >
            Packets sent from the client to the server.

        - name: geo
          title: Geo
          group: 2
          description: >
            Geo fields can carry data about a specific location related to an event
            or geo information derived from an IP field.
          type: group
          fields:

          - name: location
            level: core
            type: geo_point
            description: >
              Longitude and latitude.
            example: '{ "lon": -73.614830, "lat": 45.505918 }'

          - name: continent_name
            level: core
            type: keyword
            description: >
              Name of the continent.
            example: North America

          - name: country_name
            level: core
            type: keyword
            description: >
              Country name.
            example: Canada

          - name: region_name
            level: core
            type: keyword
            description: >
              Region name.
            example: Quebec

          - name: city_name
            level: core
            type: keyword
            description: >
              City name.
            example: Montreal

          - name: country_iso_code
            level: core
            type: keyword
            description: >
              Country ISO code.
            example: CA

          - name: region_iso_code
            level: core
            type: keyword
            description: >
              Region ISO code.
            example: CA-QC

          - name: name
            level: extended
            type: keyword
            description: >
              User-defined description of a location, at the level of granularity they care about.

              Could be the name of their data centers, the floor number, if this describes
              a local physical entity, city names.

              Not typically used in automated geolocation.
            example: boston-dc

    - name: cloud
      title: Cloud
      group: 2
      description: >
        Fields related to the cloud or infrastructure the events
        are coming from.
      footnote: >
        Examples: If Metricbeat is running on an EC2 host and fetches data from its
        host, the cloud info contains the data about this machine. If Metricbeat
        runs on a remote machine outside the cloud and fetches data from a service
        running in the cloud, the field contains cloud data from the machine the
        service is running on.
      type: group
      fields:
        - name: provider
          level: extended
          example: ec2
          type: keyword
          description: >
            Name of the cloud provider. Example values are ec2, gce, or
            digitalocean.
    
        - name: availability_zone
          level: extended
          example: us-east-1c
          type: keyword
          description: >
            Availability zone in which this host is running.
    
        - name: region
          level: extended
          type: keyword
          example: us-east-1
          description: >
            Region in which this host is running.
    
        - name: instance.id
          level: extended
          type: keyword
          example: i-1234567890abcdef0
          description: >
            Instance ID of the host machine.
    
        - name: instance.name
          level: extended
          type: keyword
          description: >
            Instance name of the host machine.
    
        - name: machine.type
          level: extended
          type: keyword
          example: t2.medium
          description: >
            Machine type of the host machine.
    
        - name: account.id
          level: extended
          type: keyword
          example: 666777888999
          description: >
            The cloud account or organization id used to identify different
            entities in a multi-tenant environment.
    
            Examples: AWS account id, Google Cloud ORG Id, or other unique
            identifier.
    
    - name: container
      title: Container
      group: 2
      description: >
        Container fields are used for meta information about the specific container
        that is the source of information. These fields help correlate data based
        containers from any runtime.
      type: group
      fields:
    
        - name: runtime
          level: extended
          type: keyword
          description: >
            Runtime managing this container.
          example: docker
    
        - name: id
          level: core
          type: keyword
          description: >
            Unique container id.
    
        - name: image.name
          level: extended
          type: keyword
          description: >
            Name of the image the container was built on.
    
        - name: image.tag
          level: extended
          type: keyword
          description: >
            Container image tag.
    
        - name: name
          level: extended
          type: keyword
          description: >
            Container name.
    
        - name: labels
          level: extended
          type: object
          object_type: keyword
          description: >
            Image labels.
    
    - name: destination
      title: Destination
      group: 2
      description: >
        Destination fields describe details about the destination of a
        packet/event. Destination fields are usually populated in conjunction with source fields.
      type: group
      fields:
    
        - name: ip
          level: core
          type: ip
          description: >
            IP address of the destination.
    
            Can be one or multiple IPv4 or IPv6 addresses.
    
        - name: port
          level: core
          type: long
          description: >
            Port of the destination.
    
        - name: mac
          level: core
          type: keyword
          description: >
            MAC address of the destination.
    
        - name: domain
          level: core
          type: keyword
          description: >
            Destination domain.
    
        # Metrics
        - name: bytes
          level: core
          type: long
          example: 184
          description: >
            Bytes sent from the destination to the source.
    
        - name: packets
          level: core
          type: long
          example: 12
          description: >
            Packets sent from the destination to the source.

        - name: geo
          title: Geo
          group: 2
          description: >
            Geo fields can carry data about a specific location related to an event
            or geo information derived from an IP field.
          type: group
          fields:

          - name: location
            level: core
            type: geo_point
            description: >
              Longitude and latitude.
            example: '{ "lon": -73.614830, "lat": 45.505918 }'

          - name: continent_name
            level: core
            type: keyword
            description: >
              Name of the continent.
            example: North America

          - name: country_name
            level: core
            type: keyword
            description: >
              Country name.
            example: Canada

          - name: region_name
            level: core
            type: keyword
            description: >
              Region name.
            example: Quebec

          - name: city_name
            level: core
            type: keyword
            description: >
              City name.
            example: Montreal

          - name: country_iso_code
            level: core
            type: keyword
            description: >
              Country ISO code.
            example: CA

          - name: region_iso_code
            level: core
            type: keyword
            description: >
              Region ISO code.
            example: CA-QC

          - name: name
            level: extended
            type: keyword
            description: >
              User-defined description of a location, at the level of granularity they care about.

              Could be the name of their data centers, the floor number, if this describes
              a local physical entity, city names.

              Not typically used in automated geolocation.
            example: boston-dc

    - name: ecs
      title: ECS
      group: 2
      description: >
        Meta-information specific to ECS.
      type: group
      fields:
    
        - name: version
          level: core
          type: keyword
          required: true
          description: >
            ECS version this event conforms to. `ecs.version` is a required field and must exist in all events.
    
            When querying across multiple indices -- which may conform to slightly
            different ECS versions -- this field lets integrations adjust to the
            schema version of the events.
    
            The current version is 1.0.0-beta1 .
          example: 1.0.0-beta1
    
    - name: error
      title: Error
      group: 2
      description: >
        These fields can represent errors of any kind. Use them for errors that
        happen while fetching events or in cases where the event itself contains an error.
    
      type: group
      fields:
        - name: id
          level: core
          type: keyword
          description: >
            Unique identifier for the error.
    
        - name: message
          level: core
          type: text
          description: >
            Error message.
    
        - name: code
          level: core
          type: keyword
          description: >
            Error code describing the error.
    
    - name: event
      title: Event
      group: 2
      description: >
        The event fields are used for context information about the log or metric event itself. A log is defined as an event containing details of something that happened. Log events must include the time at which the thing happened. Examples of log events include a process starting on a host, a network packet being sent from a source to a destination, or a network connection between a client and a server being initiated or closed. A metric is defined as an event containing one or more numerical or categorical measurements and the time at which the measurement was taken. Examples of metric events include memory pressure measured on a host, or vulnerabilities measured on a scanned host.
      type: group
      fields:
    
        - name: id
          level: core
          type: keyword
          description: >
            Unique ID to describe the event.
          example: 8a4f500d
    
        - name: kind
          level: extended
          type: keyword
          description: >
            The kind of the event.
    
            This gives information about what type of information the event
            contains, without being specific to the contents of the event.  Examples
            are `event`, `state`, `alarm`. Warning: In future versions of ECS, we
            plan to provide a list of acceptable values for this field, please use
            with caution.
          example: state
    
        - name: category
          level: core
          type: keyword
          description: >
            Event category.
    
            This contains high-level information about the contents of the event. It
            is more generic than `event.action`, in the sense that typically a
            category contains multiple actions. Warning: In future versions of ECS,
            we plan to provide a list of acceptable values for this field, please
            use with caution.
    
          example: user-management
    
        - name: action
          level: core
          type: keyword
          description: >
            The action captured by the event.
    
            This describes the information in the event. It is more specific than
            `event.category`. Examples are `group-add`, `process-started`,
            `file-created`. The value is normally defined by the implementer.
          example: user-password-change
    
        - name: outcome
          level: extended
          type: keyword
          description: >
            The outcome of the event.
    
            If the event describes an action, this fields contains the outcome of
            that action. Examples outcomes are `success` and `failure`. Warning: In
            future versions of ECS, we plan to provide a list of acceptable values
            for this field, please use with caution.
    
          example: success
    
        - name: type
          level: core
          type: keyword
          description: >
            Reserved for future usage.
    
            Please avoid using this field for user data.
    
        - name: module
          level: core
          type: keyword
          description: >
            Name of the module this data is coming from.
    
            This information is coming from the modules used in Beats or Logstash.
          example: mysql
    
        - name: dataset
          level: core
          type: keyword
          description: >
            Name of the dataset.
    
            The concept of a `dataset` (fileset / metricset) is used in Beats as a
            subset of modules. It contains the information which is currently
            stored in metricset.name and metricset.module or fileset.name.
          example: stats
    
        - name: severity
          level: core
          type: long
          example: "7"
          description: >
            Severity describes the severity of the event. What the different
            severity values mean can very different between use cases. It's up to
            the implementer to make sure severities are consistent across events.
    
        - name: original
          level: core
          type: keyword
          # Unfortunately this example is not shown correctly yet as | do not work
          # in tables well
          # Is &#124; is the representation of | it works except for cases where
          # used ticks.
          example: "Sep 19 08:26:10 host CEF:0&#124;Security&#124;
              threatmanager&#124;1.0&#124;100&#124;
              worm successfully stopped&#124;10&#124;src=10.0.0.1
              dst=2.1.2.2spt=1232"
          description: >
              Raw text message of entire event. Used to demonstrate log integrity.
    
              This field is not indexed and doc_values are disabled. It cannot be
              searched, but it can be retrieved from `_source`.
          index: false
          doc_values: false
    
        - name: hash
          level: extended
          type: keyword
          example: "123456789012345678901234567890ABCD"
          description: >
              Hash (perhaps logstash fingerprint) of raw field to be able to
              demonstrate log integrity.
    
        - name: duration
          level: core
          type: long
          description: >
            Duration of the event in nanoseconds.
    
            If event.start and event.end are known this value should be the
            difference between the end and start time.
    
        - name: timezone
          level: extended
          type: keyword
          description: >
            This field should be populated when the event's timestamp does not include
            timezone information already (e.g. default Syslog timestamps). It's
            optional otherwise.
    
            Acceptable timezone formats are: a canonical ID (e.g. "Europe/Amsterdam"),
            abbreviated (e.g. "EST") or an HH:mm differential (e.g. "-05:00").
    
        - name: created
          level: core
          type: date
          description: >
            event.created contains the date when the event was created.
    
            This timestamp is distinct from @timestamp in that @timestamp contains
            the processed timestamp. For logs these two timestamps can be different
            as the timestamp in the log line and when the event is read for example
            by Filebeat are not identical. `@timestamp` must contain the timestamp
            extracted from the log line, event.created when the log line is read.
            The same could apply to package capturing where @timestamp contains the
            timestamp extracted from the network package and event.created when the
            event was created.
    
            In case the two timestamps are identical, @timestamp should be used.
    
        - name: start
          level: extended
          type: date
          description: >
            event.start contains the date when the event started or when the
            activity was first observed.
    
        - name: end
          level: extended
          type: date
          description: >
            event.end contains the date when the event ended or when the activity
            was last observed.
    
        - name: risk_score
          level: core
          type: float
          description: >
            Risk score or priority of the event (e.g. security solutions).
            Use your system's original value here.
    
        - name: risk_score_norm
          level: extended
          type: float
          description: >
            Normalized risk score or priority of the event, on a scale of 0 to 100.
    
            This is mainly useful if you use more than one system that assigns
            risk scores, and you want to see a normalized value across all systems.
    
    - name: file
      group: 2
      title: File
      description: >
         A file is defined as a set of information that has been created on, or has existed on a filesystem. File objects can be associated with host events, network events, and/or file events (e.g., those produced by File Integrity Monitoring [FIM] products or services). File fields provide details about the affected file associated with the event or metric.
      type: group
      fields:
    
      - name: path
        level: extended
        type: keyword
        description: Path to the file.
    
      - name: target_path
        level: extended
        type: keyword
        description: Target path for symlinks.
    
      - name: extension
        level: extended
        type: keyword
        description: >
          File extension.
    
          This should allow easy filtering by file extensions.
        example: png
    
      - name: type
        level: extended
        type: keyword
        description: File type (file, dir, or symlink).
    
      - name: device
        level: extended
        type: keyword
        description: Device that is the source of the file.
    
      - name: inode
        level: extended
        type: keyword
        description: Inode representing the file in the filesystem.
    
      - name: uid
        level: extended
        type: keyword
        description: >
          The user ID (UID) or security identifier (SID) of the file owner.
    
      - name: owner
        level: extended
        type: keyword
        description: File owner's username.
    
      - name: gid
        level: extended
        type: keyword
        description: Primary group ID (GID) of the file.
    
      - name: group
        level: extended
        type: keyword
        description: Primary group name of the file.
    
      - name: mode
        level: extended
        type: keyword
        example: 0640
        description: Mode of the file in octal representation.
    
      - name: size
        level: extended
        type: long
        description: File size in bytes (field is only added when `type` is
            `file`).
    
      - name: mtime
        level: extended
        type: date
        description: Last time file content was modified.
    
      - name: ctime
        level: extended
        type: date
        description: Last time file metadata changed.
    
    - name: group
      title: Group
      group: 2
      description: >
        The group fields are meant to represent groups that are relevant to the
        event.
      type: group
      fields:
    
        - name: id
          level: extended
          type: keyword
          description: >
            Unique identifier for the group on the system/platform.
    
        - name: name
          level: extended
          type: keyword
          description: >
            Name of the group.
    
    - name: host
      title: Host
      group: 2
      description: >
        A host is defined as a general computing instance. ECS host.* fields should be populated with details about the host on which the event happened, or on which the measurement was taken. Host types include hardware, virtual machines, Docker containers, and Kubernetes nodes.
      type: group
      fields:
    
        - name: hostname
          level: core
          type: keyword
          description: >
            Hostname of the host.
    
            It normally contains what the `hostname` command returns on the host machine.
    
        - name: name
          level: core
          type: keyword
          description: >
            Name of the host.
    
            It can contain what `hostname` returns on Unix systems, the fully
            qualified domain name, or a name specified by the user. The sender
            decides which value to use.
    
        - name: id
          level: core
          type: keyword
          description: >
            Unique host id.
    
            As hostname is not always unique, use values that are meaningful
            in your environment.
    
            Example: The current usage of `beat.name`.
        - name: ip
          level: core
          type: ip
          description: >
            Host ip address.
    
        - name: mac
          level: core
          type: keyword
          description: >
            Host mac address.
    
        - name: type
          level: core
          type: keyword
          description: >
            Type of host.
    
            For Cloud providers this can be the machine type like `t2.medium`.
            If vm, this could be the container, for example, or other information
            meaningful in your environment.
    
        - name: architecture
          level: core
          type: keyword
          example: "x86_64"
          description: >
            Operating system architecture.

        - name: os
          title: Operating System
          group: 2
          description: >
            The OS fields contain information about the operating system.
          reusable:
            top_level: false
            expected:
            - observer
            - host
            - user_agent
          type: group
          fields:

          - name: platform
            level: extended
            type: keyword
            description: >
              Operating system platform (such centos, ubuntu, windows).
            example: darwin

          - name: name
            level: extended
            type: keyword
            example: "Mac OS X"
            description: >
              Operating system name.

          - name: family
            level: extended
            type: keyword
            example: "debian"
            description: >
              OS family (such as redhat, debian, freebsd, windows).

          - name: version
            level: extended
            type: keyword
            example: "10.12.6-rc2"
            description: >
              Operating system version as a raw string.

          - name: kernel
            level: extended
            type: keyword
            example: "4.4.0-112-generic"
            description: >
              Operating system kernel version as a raw string.

        - name: geo
          title: Geo
          group: 2
          description: >
            Geo fields can carry data about a specific location related to an event
            or geo information derived from an IP field.
          type: group
          fields:

          - name: location
            level: core
            type: geo_point
            description: >
              Longitude and latitude.
            example: '{ "lon": -73.614830, "lat": 45.505918 }'

          - name: continent_name
            level: core
            type: keyword
            description: >
              Name of the continent.
            example: North America

          - name: country_name
            level: core
            type: keyword
            description: >
              Country name.
            example: Canada

          - name: region_name
            level: core
            type: keyword
            description: >
              Region name.
            example: Quebec

          - name: city_name
            level: core
            type: keyword
            description: >
              City name.
            example: Montreal

          - name: country_iso_code
            level: core
            type: keyword
            description: >
              Country ISO code.
            example: CA

          - name: region_iso_code
            level: core
            type: keyword
            description: >
              Region ISO code.
            example: CA-QC

          - name: name
            level: extended
            type: keyword
            description: >
              User-defined description of a location, at the level of granularity they care about.

              Could be the name of their data centers, the floor number, if this describes
              a local physical entity, city names.

              Not typically used in automated geolocation.
            example: boston-dc

    - name: http
      title: HTTP
      group: 2
      description: >
        Fields related to HTTP activity.
      type: group
      fields:
    
        - name: request.method
          level: extended
          type: keyword
          description: >
            Http request method.
          example: GET, POST, PUT
    
        - name: request.referrer
          level: extended
          type: keyword
          description: >
            Referrer for this HTTP request.
          example: https://blog.example.com/
    
        - name: response.status_code
          level: extended
          type: long
          description: >
            Http response status code.
          example: 404
    
        - name: response.body
          level: extended
          type: keyword
          description: >
            The full http response body.
          example: Hello world
    
        - name: version
          level: extended
          type: keyword
          description: >
            Http version.
          example: 1.1
    
    - name: log
      title: Log
      description: >
        Fields which are specific to log events.
      type: group
      fields:
    
        - name: level
          level: core
          type: keyword
          description: >
            Log level of the log event.
    
            Some examples are `WARN`, `ERR`, `INFO`.
          example: ERR
    
        - name: original
          level: core
          type: keyword
          example: "Sep 19 08:26:10 localhost My log"
          index: false
          doc_values: false
          description: >
    
            This is the original log message and contains the full log message
            before splitting it up in multiple parts.
    
            In contrast to the `message` field which can contain an extracted part
            of the log message, this field contains the original, full log message.
            It can have already some modifications applied like encoding or new
            lines removed to clean up the log message.
    
            This field is not indexed and doc_values are disabled so it can't be
            queried but the value can be retrieved from `_source`.
    
    - name: network
      title: Network
      group: 2
      description: >
        The network is defined as the communication path over which a host or network event happens. The network.* fields should be populated with details about the network activity associated with an event.
      type: group
      fields:
    
        - name: name
          level: extended
          type: keyword
          description: >
            Name given by operators to sections of their network.
          example: Guest Wifi
    
        - name: type
          level: core
          type: keyword
          description: >
            In the OSI Model this would be the Network Layer. IPv4, IPv6, IPSec, PIM, etc
          example: IPv4
    
        - name: iana_number
          level: extended
          type: keyword
          description: >
              IANA Protocol Number (https://www.iana.org/assignments/protocol-numbers/protocol-numbers.xhtml).
              Standardized list of protocols. This aligns well with NetFlow and
              sFlow related logs which use the IANA Protocol Number.
          example: 6
    
        - name: transport
          level: core
          type: keyword
          description: >
            Same as network.iana_number, but instead using the Keyword name of the
            transport layer (UDP, TCP, IPv6-ICMP, etc.)
          example: TCP
    
        - name: application
          level: extended
          type: keyword
          description: >
            A name given to an application. This can be arbitrarily assigned for
            things like microservices, but also apply to things like skype, icq,
            facebook, twitter. This would be used in situations where the vendor
            or service can be decoded such as from the source/dest IP owners,
            ports, or wire format.
          example: AIM
    
        - name: protocol
          level: core
          type: keyword
          description: >
            L7 Network protocol name. ex. http, lumberjack, transport protocol
          example: http
    
        - name: direction
          level: core
          type: keyword
          description: >
            Direction of the network traffic.
    
            Recommended values are:
              * inbound
              * outbound
              * internal
              * external
              * unknown
    
            When mapping events from a host-based monitoring context, populate this
            field from the host's point of view.
    
            When mapping events from a network or perimeter-based monitoring context,
            populate this field from the point of view of your network perimeter.
          example: inbound
    
        - name: forwarded_ip
          level: core
          type: ip
          description: >
            Host IP address when the source IP address is the proxy.
          example: 192.1.1.2
    
        - name: community_id
          level: extended
          type: keyword
          description: >
            A hash of source and destination IPs and ports, as well as the protocol
            used in a communication. This is a tool-agnostic standard to identify
            flows.
    
            Learn more at https://github.com/corelight/community-id-spec.
          example: '1:hO+sN4H+MG5MY/8hIrXPqc4ZQz0='
    
        # Metrics
        - name: bytes
          level: core
          type: long
          description: >
            Total bytes transferred in both directions.
    
            If `source.bytes` and `destination.bytes` are known, `network.bytes` is their sum.
          example: 368
    
        - name: packets
          level: core
          type: long
          description: >
            Total packets transferred in both directions.
    
            If `source.packets` and `destination.packets` are known, `network.packets` is their sum.
          example: 24
    
    - name: observer
      title: Observer
      group: 2
      description: >
        An observer is defined as a special network, security, or application device used to detect, observe, or create network, security, or application-related events and metrics. This could be a custom hardware appliance or a server that has been configured to run special network, security, or application software. Examples include firewalls, intrusion detection/prevention systems, network monitoring sensors, web application firewalls, data loss prevention systems, and APM servers. The observer.* fields shall be populated with details of the system, if any, that detects, observes and/or creates a network, security, or application event or metric. Message queues and ETL components used in processing events or metrics are not considered observers in ECS.  
      type: group
      fields:
        - name: mac
          level: core
          type: keyword
          description: >
            MAC address of the observer
        - name: ip
          level: core
          type: ip
          description: >
            IP address of the observer.
        - name: hostname
          level: core
          type: keyword
          description: >
            Hostname of the observer.
        - name: vendor
          level: core
          type: keyword
          description: >
            observer vendor information.
        - name: version
          level: core
          type: keyword
          description: >
            Observer version.
        - name: serial_number
          level: extended
          type: keyword
          description: >
            Observer serial number.
        - name: type
          level: core
          type: keyword
          description: >
            The type of the observer the data is coming from.
    
            There is no predefined list of observer types. Some examples are
            `forwarder`, `firewall`, `ids`, `ips`, `proxy`, `poller`, `sensor`, `APM server`.
          example: firewall

        - name: os
          title: Operating System
          group: 2
          description: >
            The OS fields contain information about the operating system.
          reusable:
            top_level: false
            expected:
            - observer
            - host
            - user_agent
          type: group
          fields:

          - name: platform
            level: extended
            type: keyword
            description: >
              Operating system platform (such centos, ubuntu, windows).
            example: darwin

          - name: name
            level: extended
            type: keyword
            example: "Mac OS X"
            description: >
              Operating system name.

          - name: family
            level: extended
            type: keyword
            example: "debian"
            description: >
              OS family (such as redhat, debian, freebsd, windows).

          - name: version
            level: extended
            type: keyword
            example: "10.12.6-rc2"
            description: >
              Operating system version as a raw string.

          - name: kernel
            level: extended
            type: keyword
            example: "4.4.0-112-generic"
            description: >
              Operating system kernel version as a raw string.

        - name: geo
          title: Geo
          group: 2
          description: >
            Geo fields can carry data about a specific location related to an event
            or geo information derived from an IP field.
          type: group
          fields:

          - name: location
            level: core
            type: geo_point
            description: >
              Longitude and latitude.
            example: '{ "lon": -73.614830, "lat": 45.505918 }'

          - name: continent_name
            level: core
            type: keyword
            description: >
              Name of the continent.
            example: North America

          - name: country_name
            level: core
            type: keyword
            description: >
              Country name.
            example: Canada

          - name: region_name
            level: core
            type: keyword
            description: >
              Region name.
            example: Quebec

          - name: city_name
            level: core
            type: keyword
            description: >
              City name.
            example: Montreal

          - name: country_iso_code
            level: core
            type: keyword
            description: >
              Country ISO code.
            example: CA

          - name: region_iso_code
            level: core
            type: keyword
            description: >
              Region ISO code.
            example: CA-QC

          - name: name
            level: extended
            type: keyword
            description: >
              User-defined description of a location, at the level of granularity they care about.

              Could be the name of their data centers, the floor number, if this describes
              a local physical entity, city names.

              Not typically used in automated geolocation.
            example: boston-dc

    - name: organization
      title: Organization
      group: 2
      description: >
        The organization fields enrich data with information about the company or entity
        the data is associated with. These fields help you arrange or filter data stored in an index by one or multiple
        organizations.
      type: group
      fields:
    
        - name: name
          level: extended
          type: keyword
          description: >
            Organization name.
    
        - name: id
          level: extended
          type: keyword
          description: >
            Unique identifier for the organization.
    - name: os
      title: Operating System
      group: 2
      description: >
        The OS fields contain information about the operating system.
      reusable:
        top_level: false
        expected:
          - observer
          - host
          - user_agent
      type: group
      fields:
    
        - name: platform
          level: extended
          type: keyword
          description: >
            Operating system platform (such centos, ubuntu, windows).
          example: darwin
    
        - name: name
          level: extended
          type: keyword
          example: "Mac OS X"
          description: >
            Operating system name.
    
        - name: family
          level: extended
          type: keyword
          example: "debian"
          description: >
            OS family (such as redhat, debian, freebsd, windows).
    
        - name: version
          level: extended
          type: keyword
          example: "10.12.6-rc2"
          description: >
            Operating system version as a raw string.
    
        - name: kernel
          level: extended
          type: keyword
          example: "4.4.0-112-generic"
          description: >
            Operating system kernel version as a raw string.
    
    - name: process
      title: Process
      group: 2
      description: >
        These fields contain information about a process.
        These fields can help you correlate metrics information with a process id/name
        from a log message.  The `process.pid` often stays in the metric itself and is
        copied to the global field for correlation.
      type: group
      fields:
    
        - name: pid
          level: core
          type: long
          description: >
            Process id.
          exmple: ssh
    
        - name: name
          level: extended
          type: keyword
          description: >
            Process name.
    
            Sometimes called program name or similar.
          example: ssh
    
        - name: ppid
          level: extended
          type: long
          description: >
            Process parent id.
    
        - name: args
          level: extended
          type: keyword
          description: >
            Process arguments.
    
            May be filtered to protect sensitive information.
          example: ["ssh", "-l", "user", "10.0.0.16"]
    
        - name: executable
          level: extended
          type: keyword
          description: >
            Absolute path to the process executable.
          example: /usr/bin/ssh
    
        - name: title
          level: extended
          type: keyword
          description: >
            Process title.
    
            The proctitle, some times the same as process name. Can also be different:
            for example a browser setting its title to the web page currently opened.
    
        - name: thread.id
          level: extended
          type: long
          example: 4242
          description: >
            Thread ID.
    
        - name: start
          level: extended
          type: date
          example: "2016-05-23T08:05:34.853Z"
          description: >
            The time the process started.
    
        - name: working_directory
          level: extended
          type: keyword
          example: /home/alice
          description: >
            The working directory of the process.
    
    - name: related
      title: Related
      group: 2
      description: >
        This field set is meant to facilitate pivoting around a piece of data.
        Some pieces of information can be seen in many places in ECS. To facilitate
        searching for them, append values to their corresponding field in
        `related.`.
        A concrete example is IP addresses, which can be under host, observer, source, destination, client, server, and network.forwarded_ip. If you append all IPs to `related.ip`, you can then search for a given IP trivially, no matter where it appeared, by querying `related.ip:a.b.c.d`.
      type: group
      fields:
    
        - name: ip
          level: extended
          type: ip
          description: >
            All of the IPs seen on your event.
    
    - name: server
      title: Server
      group: 2
      description: >
        A Server is defined as the responder in a network connection for events regarding sessions, connections, or bidirectional flow records. For TCP events, the server is the receiver of the initial SYN packet(s) of the TCP connection. For other protocols, the server is generally the responder in the network transaction. Some systems actually use the term "responder" to refer the server in TCP connections. The server fields describe details about the system acting as the server in the network event. Server fields are usually populated in conjunction with client fields. Server fields are generally not populated for packet-level events.
      type: group
      fields:
    
        - name: ip
          level: core
          type: ip
          description: >
            IP address of the server.
    
            Can be one or multiple IPv4 or IPv6 addresses.
    
        - name: port
          level: core
          type: long
          description: >
            Port of the server.
    
        - name: mac
          level: core
          type: keyword
          description: >
            MAC address of the server.
    
        - name: domain
          level: core
          type: keyword
          description: >
            Server domain.
    
        # Metrics
        - name: bytes
          level: core
          type: long
          example: 184
          description: >
            Bytes sent from the server to the client.
    
        - name: packets
          level: core
          type: long
          example: 12
          description: >
            Packets sent from the server to the client.

        - name: geo
          title: Geo
          group: 2
          description: >
            Geo fields can carry data about a specific location related to an event
            or geo information derived from an IP field.
          type: group
          fields:

          - name: location
            level: core
            type: geo_point
            description: >
              Longitude and latitude.
            example: '{ "lon": -73.614830, "lat": 45.505918 }'

          - name: continent_name
            level: core
            type: keyword
            description: >
              Name of the continent.
            example: North America

          - name: country_name
            level: core
            type: keyword
            description: >
              Country name.
            example: Canada

          - name: region_name
            level: core
            type: keyword
            description: >
              Region name.
            example: Quebec

          - name: city_name
            level: core
            type: keyword
            description: >
              City name.
            example: Montreal

          - name: country_iso_code
            level: core
            type: keyword
            description: >
              Country ISO code.
            example: CA

          - name: region_iso_code
            level: core
            type: keyword
            description: >
              Region ISO code.
            example: CA-QC

          - name: name
            level: extended
            type: keyword
            description: >
              User-defined description of a location, at the level of granularity they care about.

              Could be the name of their data centers, the floor number, if this describes
              a local physical entity, city names.

              Not typically used in automated geolocation.
            example: boston-dc

    - name: service
      title: Service
      group: 2
      description: >
        The service fields describe the service for or from which the data was
        collected. These fields help you find and correlate logs for a specific
        service and version.
      type: group
      fields:
    
        - name: id
          level: core
          type: keyword
          description: >
            Unique identifier of the running service.
    
            This id should uniquely identify this service. This makes it possible
            to correlate logs and metrics for one specific service.
    
            Example: If you are experiencing issues with one redis instance, you
            can filter on that id to see metrics and logs for that single instance.
    
          example: d37e5ebfe0ae6c4972dbe9f0174a1637bb8247f6
    
        - name: name
          level: core
          type: keyword
          example: "elasticsearch-metrics"
          description: >
            Name of the service data is collected from.
    
            The name of the service is normally user given. This allows if two
            instances of the same service are running on the same machine
            they can be differentiated by the `service.name`.
    
            Also it allows for distributed services that run on multiple hosts to
            correlate the related instances based on the name.
    
            In the case of Elasticsearch the service.name could contain the cluster
            name. For Beats the service.name is by default a copy of the `service.type`
            field if no name is specified.
    
        - name: type
          level: core
          type: keyword
          example: "elasticsearch"
          description: >
            The type of the service data is collected from.
    
            The type can be used to group and correlate logs and metrics from one
            service type.
    
            Example: If logs or metrics are collected from Elasticsearch, `service.type` would be
            `elasticsearch`.
    
        - name: state
          level: core
          type: keyword
          description: >
            Current state of the service.
    
        - name: version
          level: core
          type: keyword
          example: "3.2.4"
          description: >
            Version of the service the data was collected from.
    
            This allows to look at a data set only for a specific version of a
            service.
    
        - name: ephemeral_id
          level: extended
          type: keyword
          description: >
            Ephemeral identifier of this service (if one exists).
    
            This id normally changes across restarts, but `service.id` does not.
          example: 8a4f500f
    
    - name: source
      title: Source
      group: 2
      description: >
        Source fields describe details about the source of a
        packet/event. Source fields are usually populated in conjunction with destination fields.
      type: group
      fields:
    
        - name: ip
          level: core
          type: ip
          description: >
            IP address of the source.
    
            Can be one or multiple IPv4 or IPv6 addresses.
    
        - name: port
          level: core
          type: long
          description: >
            Port of the source.
    
        - name: mac
          level: core
          type: keyword
          description: >
            MAC address of the source.
    
        - name: domain
          level: core
          type: keyword
          description: >
            Source domain.
    
        # Metrics
        - name: bytes
          level: core
          type: long
          example: 184
          description: >
            Bytes sent from the source to the destination.
    
        - name: packets
          level: core
          type: long
          example: 12
          description: >
            Packets sent from the source to the destination.

        - name: geo
          title: Geo
          group: 2
          description: >
            Geo fields can carry data about a specific location related to an event
            or geo information derived from an IP field.
          type: group
          fields:

          - name: location
            level: core
            type: geo_point
            description: >
              Longitude and latitude.
            example: '{ "lon": -73.614830, "lat": 45.505918 }'

          - name: continent_name
            level: core
            type: keyword
            description: >
              Name of the continent.
            example: North America

          - name: country_name
            level: core
            type: keyword
            description: >
              Country name.
            example: Canada

          - name: region_name
            level: core
            type: keyword
            description: >
              Region name.
            example: Quebec

          - name: city_name
            level: core
            type: keyword
            description: >
              City name.
            example: Montreal

          - name: country_iso_code
            level: core
            type: keyword
            description: >
              Country ISO code.
            example: CA

          - name: region_iso_code
            level: core
            type: keyword
            description: >
              Region ISO code.
            example: CA-QC

          - name: name
            level: extended
            type: keyword
            description: >
              User-defined description of a location, at the level of granularity they care about.

              Could be the name of their data centers, the floor number, if this describes
              a local physical entity, city names.

              Not typically used in automated geolocation.
            example: boston-dc


    - name: url
      title: URL
      description: >
        URL fields provide a complete URL, with scheme, host, and path.
      type: group
      fields:
    
        - name: original
          level: extended
          type: keyword
          description: >
            Unmodified original url as seen in the event source.
    
            Note that in network monitoring, the observed URL may be a full URL,
            whereas in access logs, the URL is often just represented as a path.
    
            This field is meant to represent the URL as it was observed, complete
            or not.
          example: >
            https://www.elastic.co:443/search?q=elasticsearch#top or /search?q=elasticsearch
    
        - name: full
          level: extended
          type: keyword
          description: >
            If full URLs are important to your use case, they should be stored in
            `url.full`, whether this field is reconstructed or present in the
            event source.
          example: https://www.elastic.co:443/search?q=elasticsearch#top
    
        - name: scheme
          level: extended
          type: keyword
          description: >
            Scheme of the request, such as "https".
    
            Note: The `:` is not part of the scheme.
          example: https
    
        - name: domain
          level: extended
          type: keyword
          description: >
            Domain of the request, such as "www.elastic.co".
    
            In some cases a URL may refer to an IP and/or port directly, without a
            domain name. In this case, the IP address would go to the `domain` field.
          example: www.elastic.co
    
        - name: port
          level: extended
          type: integer
          description: >
            Port of the request, such as 443.
          example: 443
    
        - name: path
          level: extended
          type: keyword
          description: >
            Path of the request, such as "/search".
    
        - name: query
          level: extended
          type: keyword
          description: >
            The query field describes the query string of the request,
            such as "q=elasticsearch".
    
            The `?` is excluded from the query string. If a URL contains
            no `?`, there is no query field. If there is a `?` but no query,
            the query field exists with an empty string. The `exists`
            query can be used to differentiate between the two cases.
    
        - name: fragment
          level: extended
          type: keyword
          description: >
            Portion of the url after the `#`, such as "top".
    
            The `#` is not part of the fragment.
    
        - name: username
          level: extended
          type: keyword
          description: >
            Username of the request.
    
        - name: password
          level: extended
          type: keyword
          description: >
            Password of the request.
    
    - name: user
      title: User
      group: 2
      description: >
        The user fields describe information about the user that is relevant
        to  the event. Fields can have one entry or multiple entries. If a
        user has more than one id, provide an array that includes all of
        them.
      reusable:
        top_level: true
        expected:
          - client
          - destination
          - host
          - server
          - source
      type: group
      fields:
    
        - name: id
          level: core
          type: keyword
          description: >
            One or multiple unique identifiers of the user.
    
        - name: name
          level: core
          type: keyword
          example: albert
          description: >
            Short name or login of the user.
    
        - name: full_name
          level: extended
          type: keyword
          example: Albert Einstein
          description: >
            User's full name, if available.
    
        - name: email
          level: extended
          type: keyword
          description: >
            User email address.
    
        - name: hash
          level: extended
          type: keyword
          description: >
            Unique user hash to correlate information for a user in anonymized form.
    
            Useful if `user.id` or `user.name` contain confidential information and
            cannot be used.
    
        - name: group
          level: extended
          type: keyword
          description: >
            Group the user is a part of. This field can contain a list of groups, if
            necessary.
    
    - name: user_agent
      title: User agent
      group: 2
      description: >
        The user_agent fields normally come from a browser request. They often
        show up in web service logs coming from the parsed user agent string.
      type: group
      fields:
    
        - name: original
          level: extended
          type: keyword
          index: false
          description: >
            Unparsed version of the user_agent.
          example: "Mozilla/5.0 (iPhone; CPU iPhone OS 12_1 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) Version/12.0 Mobile/15E148 Safari/604.1"
    
        - name: name
          level: extended
          type: keyword
          example: Safari
          description: >
            Name of the user agent.
        - name: version
          level: extended
          type: keyword
          description: >
            Version of the user agent.
          example: 12.0
    
        - name: device.name
          level: extended
          type: keyword
          example: iPhone
          description: >
            Name of the device.

        - name: os
          title: Operating System
          group: 2
          description: >
            The OS fields contain information about the operating system.
          reusable:
            top_level: false
            expected:
            - observer
            - host
            - user_agent
          type: group
          fields:

          - name: platform
            level: extended
            type: keyword
            description: >
              Operating system platform (such centos, ubuntu, windows).
            example: darwin

          - name: name
            level: extended
            type: keyword
            example: "Mac OS X"
            description: >
              Operating system name.

          - name: family
            level: extended
            type: keyword
            example: "debian"
            description: >
              OS family (such as redhat, debian, freebsd, windows).

          - name: version
            level: extended
            type: keyword
            example: "10.12.6-rc2"
            description: >
              Operating system version as a raw string.

          - name: kernel
            level: extended
            type: keyword
            example: "4.4.0-112-generic"
            description: >
              Operating system kernel version as a raw string.

    # Temporary fix to get 7.0 dashboards working.
    # This must go in the ecs.yml as otherwise tests don't work.
    - name: beat.name
      type: alias
      path: agent.type

    - name: beat.hostname
      type: alias
      path: agent.hostname

    # This is not in ECS.
    # TODO: https://github.com/elastic/ecs/issues/178
    - name: agent.hostname
      type: keyword
      description: >
        Hostname of the agent.

    # Several user_agent fields were removed from ECS.
    # TODO: Update filebeat/iis/access accordingly.
    - name: user_agent.patch
      type: keyword
      description: >
        Patch version of the user agent.
    - name: user_agent.minor
      type: keyword
      description: >
        Minor version of the user agent.
    - name: user_agent.major
      type: keyword
      description: >
        Major version of the user agent.
    - name: user_agent.device
      type: keyword
      description: >
        Name of the physical device.
    - name: user_agent.os.major
      type: long
      description: >
        Major version of the operating system.
    - name: user_agent.os.minor
      type: long
      description: >
        Minor version of the operating system.

    # url.hostname was removed from ECS.
    # TODO: Update Suricata module to use url.domain.
    - name: url.hostname
      type: keyword
      description: >
        Hostname of the request, such as "elastic.co".

- key: beat
  title: Beat
  description: >
    Contains common beat fields available in all event types.
  fields:
    - name: beat.timezone
      description: >
        The timezone as returned by the operating system on which the Beat is
        running.

    - name: "@timestamp"
      type: date
      required: true
      format: date
      example: August 26th 2016, 12:35:53.332
      description: >
        The timestamp when the event log record was generated.

    - name: tags
      description: >
        Arbitrary tags that can be set per Beat and per transaction
        type.

    - name: fields
      type: object
      object_type: keyword
      description: >
        Contains user configurable fields.

    - name: error
      type: group
      description: >
        Error fields containing additional info in case of errors.
      fields:
        - name: type
          type: keyword
          description: >
            Error type.
- key: apm
  title: General APM
  description: >
    Fields common to various APM events.
  fields:
    - name: listening
      type: keyword
      description: >
        Address the server is listening on.
    - name: processor.name
      type: keyword
      description: Processor name.

    - name: processor.event
      type: keyword
      description: Processor event.

    - name: timestamp
      type: group
      fields:
        - name: us
          type: long
          count: 1
          description: >
            Timestamp of the event in microseconds since Unix epoch.

    - name: context
      type: group
      description: >
        Any arbitrary contextual information regarding the event, captured by the agent, optionally provided by the user.
      dynamic: false
      fields:

        - name: tags
          type: object
          object_type: keyword
          dynamic: true
          description: >
            A flat mapping of user-defined tags with string values.

        - name: http
          type: group
          fields:

          - name: status_code
            type: long
            description: >
              The status code of the http response.

        - name: user
          type: group
          fields:

          - name: username
            type: keyword
            description: >
              The username of the logged in user.

          - name: id
            type: keyword
            description: >
              Identifier of the logged in user.

          - name: email
            type: keyword
            description: >
              Email of the logged in user.

          - name: ip
            type: ip
            description: >
              IP of the user where the event is recorded, typically a web browser.
              This is obtained from the X-Forwarded-For header, of which the first entry is the IP of the original client.
              This value however might not be necessarily trusted, as it can be forged by a malicious user.

          - name: user-agent
            type: text
            description: >
              Software agent acting in behalf of a user, eg. a web browser / OS combination.

        - name: request
          type: group
          fields:

          - name: url
            type: group
            description: >
              A complete Url, with scheme, host and path.
            fields:

              - name: raw
                type: keyword
                description: >
                  The raw, unparsed URL of the request, e.g https://example.com:443/search?q=elasticsearch#top.

              - name: protocol
                type: keyword
                description: >
                  The protocol of the request, e.g. "https:".

              - name: full
                type: keyword
                description: >
                  The full, possibly agent-assembled URL of the request, e.g https://example.com:443/search?q=elasticsearch#top.

              - name: hostname
                type: keyword
                description: >
                  The hostname of the request, e.g. "example.com".

              - name: port
                type: keyword
                description: >
                  The port of the request, e.g. 443.

              - name: pathname
                type: keyword
                description: >
                  The path of the request, e.g. "/search".

              - name: search
                type: keyword
                description: >
                  The search describes the query string of the request, e.g. "q=elasticsearch".

              - name: hash
                type: keyword
                description: >
                  The hash of the request URL, e.g. "top".

          - name: http_version
            type: keyword
            description: >
              The http version of the request leading to this event.

          - name: method
            type: keyword
            description: >
              The http method of the request leading to this event.

        - name: response
          type: group
          fields:

          - name: status_code
            type: long
            description: >
              The http status code of the response, eg. '200'.

          - name: finished
            type: boolean
            description: >
              A boolean indicating whether the response was finished or not.

        - name: system
          type: group
          description: >
            Optional system fields.
          fields:

            - name: hostname
              type: keyword
              description: >
                The hostname of the system the event was recorded on.

            - name: architecture
              type: keyword
              description: >
                The architecture of the system the event was recorded on.

            - name: platform
              type: keyword
              description: >
                The platform of the system the event was recorded on.

            - name: ip
              type: ip
              description: >
                IP of the host that records the event.

        - name: process
          type: group
          description: >
            Information pertaining to the running process where the data was collected
          fields:
            - name: pid
              type: long
              description: >
                Numeric process ID of the service process.

            - name: ppid
              type: long
              description: >
                Numeric ID of the service's parent process.

            - name: title
              type: keyword
              description: >
                Service process title.

        - name: service
          type: group
          description: >
            Service fields.
          fields:
            - name: name
              type: keyword
              description: >
                Immutable unique name of the service emitting this event.
              format: url
              label_template: "{{value}}"
              open_link_in_current_tab: true
              url_template:
                - min_version: "5.0.0"
                  value: "../app/kibana#/dashboard/41b5d920-7821-11e7-8c47-65b845b5cfb3?_a=(query:(query_string:(analyze_wildcard:!t,query:'context.service.name:%22{{value}}%22')))"
                - min_version: "6.0.0-alpha1"
                  value: "../app/kibana#/dashboard/41b5d920-7821-11e7-8c47-65b845b5cfb3?_a=(query:(language:lucene,query:'context.service.name:\"{{value}}\"'))"

            - name: version
              type: keyword
              description: >
                Version of the service emitting this event.

            - name: environment
              type: keyword
              description: >
                Service environment.

            - name: language
              type: group
              fields:

              - name: name
                type: keyword
                description: >
                  Name of the programming language used.

              - name: version
                type: keyword
                description: >
                  Version of the programming language used.

            - name: runtime
              type: group
              fields:

              - name: name
                type: keyword
                description: >
                  Name of the runtime used.

              - name: version
                type: keyword
                description: >
                  Version of the runtime used.

            - name: framework
              type: group
              fields:

              - name: name
                type: keyword
                description: >
                  Name of the framework used.

              - name: version
                type: keyword
                description: >
                  Version of the framework used.

            - name: agent
              type: group
              fields:

              - name: name
                type: keyword
                description: >
                  Name of the agent used.

              - name: version
                type: keyword
                description: >
                  Version of the agent used.

    - name: transaction
      type: group
      dynamic: false
      fields:
        - name: id
          type: keyword
          description: >
            The transaction ID.
          format: url
          label_template: "View Spans"
          open_link_in_current_tab: true
          url_template:
            - min_version: 5.0.0
              value: "../app/kibana#/dashboard/3e3de700-7de0-11e7-b115-df9c90da2df1?_a=(query:(query_string:(analyze_wildcard:!t,query:'transaction.id:%22{{value}}%22')))"
            - min_version: 6.0.0-alpha1
              value: "../app/kibana#/dashboard/3e3de700-7de0-11e7-b115-df9c90da2df1?_a=(query:(language:lucene,query:'transaction.id:{{value}}'))"

    - name: trace 
      type: group
      dynamic: false
      fields:
        - name: id
          type: keyword
          description: >
             The ID of the trace to which the event belongs to.

    - name: parent 
      type: group
      dynamic: false
      fields:
        - name: id
          type: keyword
          description: >
             The ID of the parent event.
- key: cloud
  title: Cloud provider metadata
  description: >
    Metadata from cloud providers added by the add_cloud_metadata processor.
  fields:

    - name: meta.cloud.provider
      example: ec2
      description: >
        Name of the cloud provider. Possible values are ec2, gce, or digitalocean.

    - name: meta.cloud.instance_id
      description: >
        Instance ID of the host machine.

    - name: meta.cloud.instance_name
      description: >
        Instance name of the host machine.

    - name: meta.cloud.machine_type
      example: t2.medium
      description: >
        Machine type of the host machine.

    - name: meta.cloud.availability_zone
      example: us-east-1c
      description: >
        Availability zone in which this host is running.

    - name: meta.cloud.project_id
      example: project-x
      description: >
        Name of the project in Google Cloud.

    - name: meta.cloud.region
      description: >
        Region in which this host is running.
- key: docker
  title: Docker
  description: >
    Docker stats collected from Docker.
  short_config: false
  anchor: docker-processor
  fields:
    - name: docker
      type: group
      fields:
        - name: container.id
          type: keyword
          description: >
            Unique container id.
        - name: container.image
          type: keyword
          description: >
            Name of the image the container was built on.
        - name: container.name
          type: keyword
          description: >
            Container name.
        - name: container.labels
          type: object
          object_type: keyword
          description: >
            Image labels.
- key: host
  title: Host
  description: >
    Info collected for the host machine.
  anchor: host-processor
  fields: {}
- key: kubernetes
  title: Kubernetes
  description: >
    Kubernetes metadata added by the kubernetes processor
  short_config: false
  anchor: kubernetes-processor
  fields:
    - name: kubernetes
      type: group
      fields:
        - name: pod.name
          type: keyword
          description: >
            Kubernetes pod name

        - name: pod.uid
          type: keyword
          description: >
            Kubernetes Pod UID

        - name: namespace
          type: keyword
          description: >
            Kubernetes namespace

        - name: node.name
          type: keyword
          description: >
            Kubernetes node name

        - name: labels
          type: object
          description: >
            Kubernetes labels map

        - name: annotations
          type: object
          description: >
            Kubernetes annotations map

        - name: container.name
          type: keyword
          description: >
            Kubernetes container name

        - name: container.image
          type: keyword
          description: >
            Kubernetes container image
- key: apm-error
  title: APM Error
  description: Error-specific data for APM
  fields:
    - name: view errors
      type: keyword
      script: "doc['context.service.name'].value"
      language: painless
      format: url
      label_template: "View Errors"
      open_link_in_current_tab: true
      url_template:
        - min_version: 5.0.0
          value: "../app/kibana#/dashboard/37f6fac0-7c6a-11e7-aa55-3b0d52c71c60?_a=(query:(query_string:(analyze_wildcard:!t,query:'context.service.name:%22{{value}}%22')))"
        - min_version: 6.0.0-alpha1
          value: "../app/kibana#/dashboard/37f6fac0-7c6a-11e7-aa55-3b0d52c71c60?_a=(query:(language:lucene,query:'context.service.name:\"{{value}}\"'))"

    - name: error id icon
      type: keyword
      script: "doc['error.grouping_key'].size() == 0 ? null : doc['error.grouping_key'].value"
      language: painless
      format: url
      label_template: "-"

    - name: error
      type: group
      description: >
        Data captured by an agent representing an event occurring in a monitored service.
      dynamic: false
      fields:

        - name: id
          type: keyword
          count: 4
          description: >
            The ID of the error.
          overwrite: true

        - name: culprit
          type: text
          count: 2
          description: Function call which was the primary perpetrator of this event.

        - name: grouping_key
          type: keyword
          description: >
            GroupingKey of the logged error for use in grouping.
          format: url
          label_template: "View Error Details"
          open_link_in_current_tab: true
          url_template:
            - min_version: 5.0.0
              value: "../app/kibana#/dashboard/5f08a870-7c6a-11e7-aa55-3b0d52c71c60?_a=(query:(query_string:(analyze_wildcard:!t,query:'error.grouping_key:%22{{value}}%22')))"
            - min_version: 6.0.0-alpha1
              value: "../app/kibana#/dashboard/5f08a870-7c6a-11e7-aa55-3b0d52c71c60?_a=(query:(language:lucene,query:'error.grouping_key:{{value}}'))"

        - name: exception
          type: group
          description: >
            Information about the originally thrown error.
          fields:

            - name: code
              type: keyword
              description: The error code set when the error happened, e.g. database error code.

            - name: message
              type: text
              count: 2
              description: The original error message.

            - name: module
              type: keyword
              description: The module namespace of the original error.

            - name: type
              type: keyword
              count: 4

            - name: handled
              type: boolean
              count: 2
              description: Indicator whether the error was caught somewhere in the code or not.


        - name: log
          type: group
          description: >
            Additional information added by logging the error.
          fields:

            - name: level
              type: keyword
              description: The severity of the record.

            - name: logger_name
              type: keyword
              description: The name of the logger instance used.

            - name: message
              type: text
              count: 2
              description: The additionally logged error message.

            - name: param_message
              type: keyword
              description: >
                A parametrized message. E.g. 'Could not connect to %s'.
                The property message is still required, and should be equal to the param_message, but with placeholders replaced.
                In some situations the param_message is used to group errors together.
- key: system
  title: "APM System Metrics"
  description: >
    System status metrics, like CPU and memory usage, that are collected from the operating system.
  short_config: true
  fields:
    - name: system
      type: group
      description: >
        `system` contains local system metrics.
      fields:

      - name: cpu
        type: group
        description: >
          `cpu` contains local CPU stats.
        fields:
        - name: total.norm.pct
          type: scaled_float
          format: percent
          description: >
            The percentage of CPU time spent by the process since the last event.
            This value is normalized by the number of CPU cores and it ranges
            from 0 to 100%.

      - name: memory
        type: group
        description: >
          `memory` contains local memory stats.
        fields:
        - name: total
          type: long
          format: bytes
          description: >
            Total memory.
        - name: actual
          type: group
          description: >
            Actual memory used and free.
          fields:
          - name: free
            type: long
            format: bytes
            description: >
              Actual free memory in bytes. It is calculated based on the OS. On Linux it consists of the free memory
              plus caches and buffers. On OSX it is a sum of free memory and the inactive memory. On Windows, it is equal
              to `system.memory.free`.

      - name: process
        type: group
        description: >
          `process` contains process metadata, CPU metrics, and memory metrics.
        fields:
        - name: cpu
          type: group
          description: >
            `cpu` contains local CPU stats.
          fields:
          - name: total.norm.pct
            type: scaled_float
            format: percent
            description: >
              The percentage of CPU time spent by the process since the last event.
              This value is normalized by the number of CPU cores and it ranges
              from 0 to 100%.
        - name: memory
          type: group
          description: Memory-specific statistics per process.
          prefix: "[float]"
          fields:
          - name: size
            type: long
            format: bytes
            description: >
              The total virtual memory the process has.
          - name: rss.bytes
            type: long
            format: bytes
            description: >
              The Resident Set Size. The amount of memory the process occupied in main memory (RAM).
- key: apm-sourcemap
  title: APM Sourcemap
  description: Sourcemap files enriched with metadata
  kibana:
    source_filters:
      - sourcemap.sourcemap
  fields:
    - name: sourcemap
      dynamic: false
      type: group
      fields:
        - name: service
          type: group
          description: >
            Service fields.
          fields:
            - name: name
              type: keyword
              description: >
                The name of the service this sourcemap belongs to.
            - name: version
              type: keyword
              description: >
                Service version.

        - name: bundle_filepath
          type: keyword
          description: >
            Location of the sourcemap relative to the file requesting it.
- key: apm-span
  title: APM Span
  description: Span-specific data for APM.
  fields:
    - name: view spans
      format: url
      label_template: "View Spans"

    - name: span
      type: group
      dynamic: false
      fields:

        - name: id
          type: long 
          description: >
            Deprecated (>= 6.5). A locally unique ID of the span.

        - name: hex_id
          type: keyword 
          description: >
            The ID of the span, introduced (>= 6.5).

        - name: name
          type: keyword
          count: 1
          description: >
            Generic designation of a span in the scope of a transaction.

        - name: type
          type: keyword
          count: 1
          description: >
            Keyword of specific relevance in the service's domain (eg: 'db.postgresql.query', 'template.erb', 'cache', etc).

        - name: subtype
          type: keyword
          count: 1
          description: >
            A further sub-division of the type (e.g. postgresql, elasticsearch)

        - name: action
          type: keyword
          count: 1
          description: >
            The specific kind of event within the sub-type represented by the span (e.g. query, connect)

        - name: start
          type: group
          fields:
            - name: us
              type: long
              count: 1
              description: >
                Offset relative to the transaction's timestamp identifying the start of the span, in microseconds.

        - name: duration
          type: group
          fields:

            - name: us
              type: long
              count: 1
              description: >
                Duration of the span, in microseconds.
              format: duration
              input_format: microseconds
              output_format: asMilliseconds
              output_precision: 0

        - name: sync 
          type: boolean
          description: >
            Indicates whether the span was executed synchronously or asynchronously.


        - name: parent
          type: long
          description: >
            Deprecated (>= 6.5). The locally unique ID of the parent of the span.
- key: apm-transaction
  title: APM Transaction
  description: Transaction-specific data for APM
  fields:
    - name: transaction
      type: group
      dynamic: false
      fields:
        - name: name
          type: text
          multi_fields:
            - name: keyword
              type: keyword
          description: >
            Generic designation of a transaction in the scope of a single service (eg. 'GET /users/:id').

        - name: type
          type: keyword
          description: >
            Keyword of specific relevance in the service's domain (eg. 'request', 'backgroundjob', etc)

        - name: duration
          type: group
          description:
          fields:

            - name: us
              type: long
              description: >
                Total duration of this transaction, in microseconds.
              format: duration
              input_format: microseconds
              output_format: asMilliseconds
              output_precision: 0

        - name: result
          type: keyword
          description: >
            The result of the transaction. HTTP status code for HTTP-related transactions.

        - name: marks
          type: object
          object_type: keyword
          dynamic: true
          description: >
            A user-defined mapping of groups of marks in milliseconds.

        - name: marks.navigationTiming
          type: object
          object_type: scaled_float
          scaling_factor: 1000000
          dynamic: true

        - name: sampled
          type: boolean
          description: >
            Transactions that are 'sampled' will include all available information. Transactions that are not sampled will not have spans or context. Defaults to true.

        - name: span_count
          type: group
          fields:
            - name: dropped
              type: group
              fields:
                - name: total
                  type: long
                  description: The total amount of dropped spans for this transaction.
