forked from vectordotdev/vector
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmod.rs
More file actions
27 lines (23 loc) · 638 Bytes
/
Copy pathmod.rs
File metadata and controls
27 lines (23 loc) · 638 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
pub mod logs;
pub mod metrics;
use crate::sinks::splunk_hec;
use serde::{Deserialize, Serialize};
#[derive(Deserialize, Serialize, Debug, Eq, PartialEq, Clone, Derivative)]
#[serde(rename_all = "snake_case")]
#[derivative(Default)]
pub enum Encoding {
#[derivative(Default)]
Json,
Text,
}
impl From<Encoding> for splunk_hec::Encoding {
fn from(v: Encoding) -> Self {
match v {
Encoding::Json => splunk_hec::Encoding::Json,
Encoding::Text => splunk_hec::Encoding::Text,
}
}
}
fn default_host_key() -> String {
crate::config::LogSchema::default().host_key().to_string()
}