pub struct LogScaleUnstructuredLogger { /* private fields */ }Implementations§
Source§impl LogScaleUnstructuredLogger
impl LogScaleUnstructuredLogger
Sourcepub fn init(
url: String,
ingest_token: String,
options: LoggerOptions,
) -> Result<(), Box<dyn Error>>
pub fn init( url: String, ingest_token: String, options: LoggerOptions, ) -> Result<(), Box<dyn Error>>
Examples found in repository?
examples/log_unstructured.rs (lines 17-21)
9async fn main() {
10 let args: Vec<String> = env::args().collect();
11
12 let ingest_token = args
13 .get(1)
14 .expect("Missing '--ingest-token' parameter.")
15 .replace("--ingest-token=", "");
16
17 LogScaleUnstructuredLogger::init(
18 String::from("https://cloud.community.humio.com"),
19 ingest_token,
20 LoggerOptions::default(),
21 )
22 .unwrap();
23
24 log::set_max_level(log::LevelFilter::Trace);
25
26 // Loop to let the background sync task have time to do its thing.
27 // Assumes that the provided ingest token has been set up with an "accesslog" parser to be able to parse the log line below.
28 loop {
29 info!("192.168.1.21 - user1 [26/Sep/2023:14:48:26 +0000] \"POST /humio/api/v1/ingest/elastic-bulk HTTP/1.1\" 200 0 \"-\" \"useragent\" 0.015 664 0.015");
30
31 std::thread::sleep(Duration::from_secs(1));
32 }
33}Trait Implementations§
Source§impl Log for LogScaleUnstructuredLogger
impl Log for LogScaleUnstructuredLogger
Auto Trait Implementations§
impl Freeze for LogScaleUnstructuredLogger
impl !RefUnwindSafe for LogScaleUnstructuredLogger
impl Send for LogScaleUnstructuredLogger
impl Sync for LogScaleUnstructuredLogger
impl Unpin for LogScaleUnstructuredLogger
impl !UnwindSafe for LogScaleUnstructuredLogger
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more