pub struct Host { /* private fields */ }Expand 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 from which the measurement was taken. Host types include hardware, virtual machines, Docker containers, and Kubernetes nodes.
Implementations§
Source§impl Host
impl Host
Sourcepub fn get_hostname(&self) -> Option<&String>
pub fn get_hostname(&self) -> Option<&String>
Hostname of the host.
It normally contains what the hostname command returns on the host machine.
Sourcepub fn set_hostname(&mut self, hostname_arg: String)
pub fn set_hostname(&mut self, hostname_arg: String)
Hostname of the host.
It normally contains what the hostname command returns on the host machine.
Sourcepub fn get_name(&self) -> Option<&String>
pub fn get_name(&self) -> Option<&String>
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.
Sourcepub fn set_name(&mut self, name_arg: String)
pub fn set_name(&mut self, name_arg: String)
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.
Sourcepub fn get_id(&self) -> Option<&String>
pub fn get_id(&self) -> Option<&String>
Unique host id.
As hostname is not always unique, use values that are meaningful in your environment.
Example: The current usage of beat.name.
Sourcepub fn set_id(&mut self, id_arg: String)
pub fn set_id(&mut self, id_arg: String)
Unique host id.
As hostname is not always unique, use values that are meaningful in your environment.
Example: The current usage of beat.name.
Sourcepub fn get_mac(&self) -> &Vec<String>
pub fn get_mac(&self) -> &Vec<String>
Host MAC addresses.
The notation format from RFC 7042 is suggested: Each octet (that is, 8-bit byte) is represented by two [uppercase] hexadecimal digits giving the value of the octet as an unsigned integer. Successive octets are separated by a hyphen.
Sourcepub fn add_mac(&mut self, mac_arg: String)
pub fn add_mac(&mut self, mac_arg: String)
Host MAC addresses.
The notation format from RFC 7042 is suggested: Each octet (that is, 8-bit byte) is represented by two [uppercase] hexadecimal digits giving the value of the octet as an unsigned integer. Successive octets are separated by a hyphen.
§Example
["00-00-5E-00-53-23", "00-00-5E-00-53-24"]
Sourcepub fn get_type(&self) -> Option<&String>
pub fn get_type(&self) -> Option<&String>
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.
Sourcepub fn set_type(&mut self, type_arg: String)
pub fn set_type(&mut self, type_arg: String)
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.
Sourcepub fn get_uptime(&self) -> Option<&u64>
pub fn get_uptime(&self) -> Option<&u64>
Seconds the host has been up.
Sourcepub fn set_uptime(&mut self, uptime_arg: u64)
pub fn set_uptime(&mut self, uptime_arg: u64)
Sourcepub fn get_architecture(&self) -> Option<&String>
pub fn get_architecture(&self) -> Option<&String>
Operating system architecture.
Sourcepub fn set_architecture(&mut self, architecture_arg: String)
pub fn set_architecture(&mut self, architecture_arg: String)
Sourcepub fn get_domain(&self) -> Option<&String>
pub fn get_domain(&self) -> Option<&String>
Name of the domain of which the host is a member.
For example, on Windows this could be the host’s Active Directory domain or NetBIOS domain name. For Linux this could be the domain of the host’s LDAP provider.
Sourcepub fn set_domain(&mut self, domain_arg: String)
pub fn set_domain(&mut self, domain_arg: String)
Name of the domain of which the host is a member.
For example, on Windows this could be the host’s Active Directory domain or NetBIOS domain name. For Linux this could be the domain of the host’s LDAP provider.
§Example
CONTOSO
Sourcepub fn get_cpu_usage(&self) -> Option<&String>
pub fn get_cpu_usage(&self) -> Option<&String>
Percent CPU used which is normalized by the number of CPU cores and it ranges from 0 to 1.
Scaling factor: 1000.
For example: For a two core host, this value should be the average of the two cores, between 0 and 1.
Sourcepub fn set_cpu_usage(&mut self, cpu_usage_arg: String)
pub fn set_cpu_usage(&mut self, cpu_usage_arg: String)
Percent CPU used which is normalized by the number of CPU cores and it ranges from 0 to 1.
Scaling factor: 1000.
For example: For a two core host, this value should be the average of the two cores, between 0 and 1.
Sourcepub fn get_disk_read_bytes(&self) -> Option<&u64>
pub fn get_disk_read_bytes(&self) -> Option<&u64>
The total number of bytes (gauge) read successfully (aggregated from all disks) since the last metric collection.
Sourcepub fn set_disk_read_bytes(&mut self, disk_read_bytes_arg: u64)
pub fn set_disk_read_bytes(&mut self, disk_read_bytes_arg: u64)
The total number of bytes (gauge) read successfully (aggregated from all disks) since the last metric collection.
Sourcepub fn get_disk_write_bytes(&self) -> Option<&u64>
pub fn get_disk_write_bytes(&self) -> Option<&u64>
The total number of bytes (gauge) written successfully (aggregated from all disks) since the last metric collection.
Sourcepub fn set_disk_write_bytes(&mut self, disk_write_bytes_arg: u64)
pub fn set_disk_write_bytes(&mut self, disk_write_bytes_arg: u64)
The total number of bytes (gauge) written successfully (aggregated from all disks) since the last metric collection.
Sourcepub fn get_network_ingress_bytes(&self) -> Option<&u64>
pub fn get_network_ingress_bytes(&self) -> Option<&u64>
The number of bytes received (gauge) on all network interfaces by the host since the last metric collection.
Sourcepub fn set_network_ingress_bytes(&mut self, network_ingress_bytes_arg: u64)
pub fn set_network_ingress_bytes(&mut self, network_ingress_bytes_arg: u64)
The number of bytes received (gauge) on all network interfaces by the host since the last metric collection.
Sourcepub fn get_network_ingress_packets(&self) -> Option<&u64>
pub fn get_network_ingress_packets(&self) -> Option<&u64>
The number of packets (gauge) received on all network interfaces by the host since the last metric collection.
Sourcepub fn set_network_ingress_packets(&mut self, network_ingress_packets_arg: u64)
pub fn set_network_ingress_packets(&mut self, network_ingress_packets_arg: u64)
The number of packets (gauge) received on all network interfaces by the host since the last metric collection.
Sourcepub fn get_network_egress_bytes(&self) -> Option<&u64>
pub fn get_network_egress_bytes(&self) -> Option<&u64>
The number of bytes (gauge) sent out on all network interfaces by the host since the last metric collection.
Sourcepub fn set_network_egress_bytes(&mut self, network_egress_bytes_arg: u64)
pub fn set_network_egress_bytes(&mut self, network_egress_bytes_arg: u64)
The number of bytes (gauge) sent out on all network interfaces by the host since the last metric collection.
Sourcepub fn get_network_egress_packets(&self) -> Option<&u64>
pub fn get_network_egress_packets(&self) -> Option<&u64>
The number of packets (gauge) sent out on all network interfaces by the host since the last metric collection.
Sourcepub fn set_network_egress_packets(&mut self, network_egress_packets_arg: u64)
pub fn set_network_egress_packets(&mut self, network_egress_packets_arg: u64)
The number of packets (gauge) sent out on all network interfaces by the host since the last metric collection.
Sourcepub fn get_boot_id(&self) -> Option<&String>
pub fn get_boot_id(&self) -> Option<&String>
Linux boot uuid taken from /proc/sys/kernel/random/boot_id. Note the boot_id value from /proc may or may not be the same in containers as on the host. Some container runtimes will bind mount a new boot_id value onto the proc file in each container.
Sourcepub fn set_boot_id(&mut self, boot_id_arg: String)
pub fn set_boot_id(&mut self, boot_id_arg: String)
Linux boot uuid taken from /proc/sys/kernel/random/boot_id. Note the boot_id value from /proc may or may not be the same in containers as on the host. Some container runtimes will bind mount a new boot_id value onto the proc file in each container.
§Example
88a1f0ed-5ae5-41ee-af6b-41921c311872
Sourcepub fn get_pid_ns_ino(&self) -> Option<&String>
pub fn get_pid_ns_ino(&self) -> Option<&String>
This is the inode number of the namespace in the namespace file system (nsfs). Unsigned int inum in include/linux/ns_common.h.
Sourcepub fn set_pid_ns_ino(&mut self, pid_ns_ino_arg: String)
pub fn set_pid_ns_ino(&mut self, pid_ns_ino_arg: String)
This is the inode number of the namespace in the namespace file system (nsfs). Unsigned int inum in include/linux/ns_common.h.
§Example
256383