Archived: This project is based on the old
0.10.x
version ofemit
and isn't compatible with newer versions.
Log events with the emit
structured logger to Elasticsearch.
This is a lightweight Collector
that indexes events in a timestamped index with a _bulk
command.
The template format can be changed by specifying an IndexTemplate
, but the log type will always
be emitlog
.
Logged events should play nice with kibana out-of-the-box.
Reference emit_elasticsearch
in your Cargo.toml
:
[dependencies]
emit = "*"
emit_elasticsearch = "*"
Log to Elasticsearch by adding an ElasticCollector
to your pipeline:
#[macro_use]
extern crate emit;
extern crate emit_elasticsearch;
use emit::PipelineBuilder;
use emit_elasticsearch::prelude::*;
let pipeline = PipelineBuilder::new()
.write_to(
ElasticCollector::default()
.send_template().unwrap())
.init();