Struct DataStream

Source
pub struct DataStream { /* private fields */ }
Expand description

The data_stream fields take part in defining the new data stream naming scheme.

In the new data stream naming scheme the value of the data stream fields combine to the name of the actual data stream in the following manner: {data_stream.type}-{data_stream.dataset}-{data_stream.namespace}. This means the fields can only contain characters that are valid as part of names of data streams. More details about this can be found in this blog post.

An Elasticsearch data stream consists of one or more backing indices, and a data stream name forms part of the backing indices names. Due to this convention, data streams must also follow index naming restrictions. For example, data stream names cannot include \, /, *, ?, ", <, >, |, (space character), ,, or #. Please see the Elasticsearch reference for additional restrictions.

Implementations§

Source§

impl DataStream

Source

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

An overarching type for the data stream.

Currently allowed values are “logs” and “metrics”. We expect to also add “traces” and “synthetics” in the near future.

Source

pub fn set_type(&mut self, type_arg: String)

An overarching type for the data stream.

Currently allowed values are “logs” and “metrics”. We expect to also add “traces” and “synthetics” in the near future.

§Example

logs

Source

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

The field can contain anything that makes sense to signify the source of the data.

Examples include nginx.access, prometheus, endpoint etc. For data streams that otherwise fit, but that do not have dataset set we use the value “generic” for the dataset value. event.dataset should have the same value as data_stream.dataset.

Beyond the Elasticsearch data stream naming criteria noted above, the dataset value has additional restrictions:

  • Must not contain -

  • No longer than 100 characters

Source

pub fn set_dataset(&mut self, dataset_arg: String)

The field can contain anything that makes sense to signify the source of the data.

Examples include nginx.access, prometheus, endpoint etc. For data streams that otherwise fit, but that do not have dataset set we use the value “generic” for the dataset value. event.dataset should have the same value as data_stream.dataset.

Beyond the Elasticsearch data stream naming criteria noted above, the dataset value has additional restrictions:

  • Must not contain -

  • No longer than 100 characters

§Example

nginx.access

Source

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

A user defined namespace. Namespaces are useful to allow grouping of data.

Many users already organize their indices this way, and the data stream naming scheme now provides this best practice as a default. Many users will populate this field with default. If no value is used, it falls back to default.

Beyond the Elasticsearch index naming criteria noted above, namespace value has the additional restrictions:

  • Must not contain -

  • No longer than 100 characters

Source

pub fn set_namespace(&mut self, namespace_arg: String)

A user defined namespace. Namespaces are useful to allow grouping of data.

Many users already organize their indices this way, and the data stream naming scheme now provides this best practice as a default. Many users will populate this field with default. If no value is used, it falls back to default.

Beyond the Elasticsearch index naming criteria noted above, namespace value has the additional restrictions:

  • Must not contain -

  • No longer than 100 characters

§Example

production

Trait Implementations§

Source§

impl Clone for DataStream

Source§

fn clone(&self) -> DataStream

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

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

Performs copy-assignment from source. Read more
Source§

impl Default for DataStream

Source§

fn default() -> DataStream

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

impl Serialize for DataStream

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§

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.