Host

Struct Host 

Source
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

Source

pub fn get_hostname(&self) -> Option<&String>

Hostname of the host.

It normally contains what the hostname command returns on the host machine.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

pub fn get_ip(&self) -> &Vec<String>

Host ip addresses.

Source

pub fn add_ip(&mut self, ip_arg: String)

Host ip addresses.

Source

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.

Source

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"]

Source

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.

Source

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.

Source

pub fn get_uptime(&self) -> Option<&u64>

Seconds the host has been up.

Source

pub fn set_uptime(&mut self, uptime_arg: u64)

Seconds the host has been up.

§Example

1325

Source

pub fn get_architecture(&self) -> Option<&String>

Operating system architecture.

Source

pub fn set_architecture(&mut self, architecture_arg: String)

Operating system architecture.

§Example

x86_64

Source

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.

Source

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

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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.

Source

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

Source

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.

Source

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

Trait Implementations§

Source§

impl Clone for Host

Source§

fn clone(&self) -> Host

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Default for Host

Source§

fn default() -> Host

Returns the “default value” for a type. Read more
Source§

impl Serialize for Host

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more

Auto Trait Implementations§

§

impl Freeze for Host

§

impl RefUnwindSafe for Host

§

impl Send for Host

§

impl Sync for Host

§

impl Unpin for Host

§

impl UnwindSafe for Host

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.