pub struct Log { /* private fields */ }Expand description
Details about the event’s logging mechanism or logging transport.
The log.* fields are typically populated with details about the logging mechanism used to create and/or transport the event. For example, syslog details belong under log.syslog.*.
The details specific to your event source are typically not logged under log.*, but rather in event.* or in other ECS fields.
Implementations§
Source§impl Log
impl Log
Sourcepub fn get_level(&self) -> Option<&String>
pub fn get_level(&self) -> Option<&String>
Original log level of the log event.
If the source of the event provides a log level or textual severity, this is the one that goes in log.level. If your source doesn’t specify one, you may put your event transport’s severity here (e.g. Syslog severity).
Some examples are warn, err, i, informational.
Sourcepub fn set_level(&mut self, level_arg: String)
pub fn set_level(&mut self, level_arg: String)
Original log level of the log event.
If the source of the event provides a log level or textual severity, this is the one that goes in log.level. If your source doesn’t specify one, you may put your event transport’s severity here (e.g. Syslog severity).
Some examples are warn, err, i, informational.
§Example
error
Sourcepub fn get_file_path(&self) -> Option<&String>
pub fn get_file_path(&self) -> Option<&String>
Full path to the log file this event came from, including the file name. It should include the drive letter, when appropriate.
If the event wasn’t read from a log file, do not populate this field.
Sourcepub fn set_file_path(&mut self, file_path_arg: String)
pub fn set_file_path(&mut self, file_path_arg: String)
Full path to the log file this event came from, including the file name. It should include the drive letter, when appropriate.
If the event wasn’t read from a log file, do not populate this field.
§Example
/var/log/fun-times.log
Sourcepub fn get_logger(&self) -> Option<&String>
pub fn get_logger(&self) -> Option<&String>
The name of the logger inside an application. This is usually the name of the class which initialized the logger, or can be a custom name.
Sourcepub fn set_logger(&mut self, logger_arg: String)
pub fn set_logger(&mut self, logger_arg: String)
The name of the logger inside an application. This is usually the name of the class which initialized the logger, or can be a custom name.
§Example
org.elasticsearch.bootstrap.Bootstrap
Sourcepub fn get_origin_file_name(&self) -> Option<&String>
pub fn get_origin_file_name(&self) -> Option<&String>
The name of the file containing the source code which originated the log event.
Note that this field is not meant to capture the log file. The correct field to capture the log file is log.file.path.
Sourcepub fn set_origin_file_name(&mut self, origin_file_name_arg: String)
pub fn set_origin_file_name(&mut self, origin_file_name_arg: String)
The name of the file containing the source code which originated the log event.
Note that this field is not meant to capture the log file. The correct field to capture the log file is log.file.path.
§Example
Bootstrap.java
Sourcepub fn get_origin_file_line(&self) -> Option<&u64>
pub fn get_origin_file_line(&self) -> Option<&u64>
The line number of the file containing the source code which originated the log event.
Sourcepub fn set_origin_file_line(&mut self, origin_file_line_arg: u64)
pub fn set_origin_file_line(&mut self, origin_file_line_arg: u64)
Sourcepub fn get_origin_function(&self) -> Option<&String>
pub fn get_origin_function(&self) -> Option<&String>
The name of the function or method which originated the log event.
Sourcepub fn set_origin_function(&mut self, origin_function_arg: String)
pub fn set_origin_function(&mut self, origin_function_arg: String)
Sourcepub fn get_syslog(&self) -> Option<&Value>
pub fn get_syslog(&self) -> Option<&Value>
The Syslog metadata of the event, if the event was transmitted via Syslog. Please see RFCs 5424 or 3164.
Sourcepub fn set_syslog(&mut self, syslog_arg: Value)
pub fn set_syslog(&mut self, syslog_arg: Value)
The Syslog metadata of the event, if the event was transmitted via Syslog. Please see RFCs 5424 or 3164.
Sourcepub fn get_syslog_severity_code(&self) -> Option<&u64>
pub fn get_syslog_severity_code(&self) -> Option<&u64>
The Syslog numeric severity of the log event, if available.
If the event source publishing via Syslog provides a different numeric severity value (e.g. firewall, IDS), your source’s numeric severity should go to event.severity. If the event source does not specify a distinct severity, you can optionally copy the Syslog severity to event.severity.
Sourcepub fn set_syslog_severity_code(&mut self, syslog_severity_code_arg: u64)
pub fn set_syslog_severity_code(&mut self, syslog_severity_code_arg: u64)
The Syslog numeric severity of the log event, if available.
If the event source publishing via Syslog provides a different numeric severity value (e.g. firewall, IDS), your source’s numeric severity should go to event.severity. If the event source does not specify a distinct severity, you can optionally copy the Syslog severity to event.severity.
§Example
3
Sourcepub fn get_syslog_severity_name(&self) -> Option<&String>
pub fn get_syslog_severity_name(&self) -> Option<&String>
The Syslog numeric severity of the log event, if available.
If the event source publishing via Syslog provides a different severity value (e.g. firewall, IDS), your source’s text severity should go to log.level. If the event source does not specify a distinct severity, you can optionally copy the Syslog severity to log.level.
Sourcepub fn set_syslog_severity_name(&mut self, syslog_severity_name_arg: String)
pub fn set_syslog_severity_name(&mut self, syslog_severity_name_arg: String)
The Syslog numeric severity of the log event, if available.
If the event source publishing via Syslog provides a different severity value (e.g. firewall, IDS), your source’s text severity should go to log.level. If the event source does not specify a distinct severity, you can optionally copy the Syslog severity to log.level.
§Example
Error
Sourcepub fn get_syslog_facility_code(&self) -> Option<&u64>
pub fn get_syslog_facility_code(&self) -> Option<&u64>
The Syslog numeric facility of the log event, if available.
According to RFCs 5424 and 3164, this value should be an integer between 0 and 23.
Sourcepub fn set_syslog_facility_code(&mut self, syslog_facility_code_arg: u64)
pub fn set_syslog_facility_code(&mut self, syslog_facility_code_arg: u64)
The Syslog numeric facility of the log event, if available.
According to RFCs 5424 and 3164, this value should be an integer between 0 and 23.
§Example
23
Sourcepub fn get_syslog_facility_name(&self) -> Option<&String>
pub fn get_syslog_facility_name(&self) -> Option<&String>
The Syslog text-based facility of the log event, if available.
Sourcepub fn set_syslog_facility_name(&mut self, syslog_facility_name_arg: String)
pub fn set_syslog_facility_name(&mut self, syslog_facility_name_arg: String)
Sourcepub fn get_syslog_priority(&self) -> Option<&u64>
pub fn get_syslog_priority(&self) -> Option<&u64>
Syslog numeric priority of the event, if available.
According to RFCs 5424 and 3164, the priority is 8 * facility + severity. This number is therefore expected to contain a value between 0 and 191.
Sourcepub fn set_syslog_priority(&mut self, syslog_priority_arg: u64)
pub fn set_syslog_priority(&mut self, syslog_priority_arg: u64)
Syslog numeric priority of the event, if available.
According to RFCs 5424 and 3164, the priority is 8 * facility + severity. This number is therefore expected to contain a value between 0 and 191.
§Example
135
Sourcepub fn get_syslog_version(&self) -> Option<&String>
pub fn get_syslog_version(&self) -> Option<&String>
The version of the Syslog protocol specification. Only applicable for RFC 5424 messages.
Sourcepub fn set_syslog_version(&mut self, syslog_version_arg: String)
pub fn set_syslog_version(&mut self, syslog_version_arg: String)
Sourcepub fn get_syslog_hostname(&self) -> Option<&String>
pub fn get_syslog_hostname(&self) -> Option<&String>
The hostname, FQDN, or IP of the machine that originally sent the Syslog message. This is sourced from the hostname field of the syslog header. Depending on the environment, this value may be different from the host that handled the event, especially if the host handling the events is acting as a collector.
Sourcepub fn set_syslog_hostname(&mut self, syslog_hostname_arg: String)
pub fn set_syslog_hostname(&mut self, syslog_hostname_arg: String)
The hostname, FQDN, or IP of the machine that originally sent the Syslog message. This is sourced from the hostname field of the syslog header. Depending on the environment, this value may be different from the host that handled the event, especially if the host handling the events is acting as a collector.
§Example
example-host
Sourcepub fn get_syslog_appname(&self) -> Option<&String>
pub fn get_syslog_appname(&self) -> Option<&String>
The device or application that originated the Syslog message, if available.
Sourcepub fn set_syslog_appname(&mut self, syslog_appname_arg: String)
pub fn set_syslog_appname(&mut self, syslog_appname_arg: String)
Sourcepub fn get_syslog_procid(&self) -> Option<&String>
pub fn get_syslog_procid(&self) -> Option<&String>
The process name or ID that originated the Syslog message, if available.
Sourcepub fn set_syslog_procid(&mut self, syslog_procid_arg: String)
pub fn set_syslog_procid(&mut self, syslog_procid_arg: String)
Sourcepub fn get_syslog_msgid(&self) -> Option<&String>
pub fn get_syslog_msgid(&self) -> Option<&String>
An identifier for the type of Syslog message, if available. Only applicable for RFC 5424 messages.
Sourcepub fn set_syslog_msgid(&mut self, syslog_msgid_arg: String)
pub fn set_syslog_msgid(&mut self, syslog_msgid_arg: String)
An identifier for the type of Syslog message, if available. Only applicable for RFC 5424 messages.
§Example
ID47
Sourcepub fn get_syslog_structured_data(&self) -> Option<&String>
pub fn get_syslog_structured_data(&self) -> Option<&String>
Structured data expressed in RFC 5424 messages, if available. These are key-value pairs formed from the structured data portion of the syslog message, as defined in RFC 5424 Section 6.3.
Sourcepub fn set_syslog_structured_data(&mut self, syslog_structured_data_arg: String)
pub fn set_syslog_structured_data(&mut self, syslog_structured_data_arg: String)
Structured data expressed in RFC 5424 messages, if available. These are key-value pairs formed from the structured data portion of the syslog message, as defined in RFC 5424 Section 6.3.