emit-rs / emit_elasticsearch

Elasticsearch collector for the emit structured logger
Apache License 2.0
0 stars 1 forks source link

Archived: This project is based on the old 0.10.x version of emit and isn't compatible with newer versions.

emit_elasticsearch Documentation

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.

Usage

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();

Event in es