forked from elastic/beats
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
* Initialize Journalbeat (elastic#8277) This is the first PR to initialize Journalbeat with minimal functionality. The architecture is mimicing Filebeat so it can be merged into FB in the future. It means it has multiple inputs which can share configuration (`backoff`, `backoff_factor`, etc.). Inputs can have multiple readers, each reader reads from a journal specified in the list of `paths`. The readers are not going to implement the interface `Harverster` until it's merged into Filebeat, because it would overcomplicate event publishing unnecessarily and would need to duplicate too much Filebeat code. Checkpointing is copied from Winlogbeat. Once the new registry file is merged, it will be migrated. Example configuration to read from the beginning of the local journal ```yml journalbeat.inputs: - paths: [] seek: head ``` Features * read from local journal, journal file and directory * position tracking by using check-pointing as it's done in Winlogbeat * seek to "tail", "head", "cursor" * minimal E2E tests * fields.yml and documentation Vendored: * github.com/coreos/go-systemd/sdjournal * Journalbeat matches support && minor additions (elastic#8324) From now on it's possible to match for journal entry fields in Journalbeat using the new option `matches`. This requires a list of key value pairs separated by "=". The key has to be a journalbeat event key (e.g systemd.unit) and the value is the exact value journal reader needs to find in the entries. Example configuration which returns NGINX and dhclient entries from the journal: ```yml include_matches: - "systemd.unit=nginx" - "process.name=dhclient" ``` Added docker fields from: https://docs.docker.com/config/containers/logging/journald/ - `container.id` - `container.id_truncated` - `container.name` - `container.image.tag` - `container.partial` Journalbeat parses the timestamp of the entry and adds it to the event as `@timestamp`. The time of reading by Journalbeat is saved in `read_timestamp`. Custom fields by various sources are stored under `custom`. Field names are normalized, meaning `"_"` prefix is removed and every letter is lowercase. From now on it is possible to configure `processors` and `fields`, etc on `input` level. The size of each open reader is reporting in bytes: ``` { "journalbeat": { "journals": { "journal_1": { "path": "system.journal", "size_in_bytes": 123124214, } } } ``` * Minor improvements to Journalbeat (elastic#8618) * Packaging of journalbeat (elastic#8702) Journalbeat is going to be built using the new Debian 8 container, because systemd version in Debian 7 is too old (v44 instead of the required v187). Minor changes: * add missing X-Pack folder to journalbeat * do not crosscompile journalbeat due to missing dependencies locally * Add journalbeat docs (elastic#8735) * Add journalbeat docs (cherry picked from commit 24d0e08)
- Loading branch information
Showing
80 changed files
with
7,963 additions
and
18 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
/.idea | ||
/build | ||
.DS_Store | ||
.journalbeat_position | ||
/journalbeat | ||
/journalbeat.test | ||
*.pyc | ||
data/meta.json | ||
/*.journal |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
FROM golang:1.10.3 | ||
MAINTAINER Noémi Ványi <[email protected]> | ||
|
||
RUN set -x && \ | ||
apt-get update && \ | ||
apt-get install -y --no-install-recommends \ | ||
python-pip virtualenv libsystemd-dev libc6-dev-i386 gcc-arm-linux-gnueabi && \ | ||
apt-get clean | ||
|
||
RUN pip install --upgrade setuptools | ||
|
||
# Setup work environment | ||
ENV JOURNALBEAT_PATH /go/src/github.com/elastic/beats/journalbeat | ||
|
||
RUN mkdir -p $JOURNALBEAT_PATH/build/coverage | ||
WORKDIR $JOURNALBEAT_PATH | ||
HEALTHCHECK CMD exit 0 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,15 @@ | ||
BEAT_NAME=journalbeat | ||
BEAT_TITLE=Journalbeat | ||
SYSTEM_TESTS=false | ||
TEST_ENVIRONMENT=false | ||
ES_BEATS?=.. | ||
|
||
# Path to the libbeat Makefile | ||
-include $(ES_BEATS)/libbeat/scripts/Makefile | ||
|
||
.PHONY: before-build | ||
before-build: | ||
|
||
# Collects all dependencies and then calls update | ||
.PHONY: collect | ||
collect: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,5 @@ | ||
# Journalbeat | ||
|
||
Journalbeat is an open source data collector to read and forward journal entries from Linuxes with systemd. | ||
|
||
## Getting started |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
###################### Journalbeat Configuration Example ######################### | ||
|
||
# This file is an example configuration file highlighting only the most common | ||
# options. The journalbeat.reference.yml file from the same directory contains all the | ||
# supported options with more comments. You can use it as a reference. | ||
# | ||
# You can find the full configuration reference here: | ||
# https://www.elastic.co/guide/en/beats/journalbeat/index.html | ||
|
||
# For more available modules and options, please see the journalbeat.reference.yml sample | ||
# configuration file. | ||
|
||
#=========================== Journalbeat inputs ============================= | ||
|
||
journalbeat.inputs: | ||
# Paths that should be crawled and fetched. Possible values files and directories. | ||
# When setting a directory, all journals under it are merged. | ||
# When empty starts to read from local journal. | ||
- paths: [] | ||
|
||
# The number of seconds to wait before trying to read again from journals. | ||
#backoff: 1s | ||
# The maximum number of seconds to wait before attempting to read again from journals. | ||
#max_backoff: 60s | ||
|
||
# Position to start reading from journal. Valid values: head, tail, cursor | ||
seek: tail | ||
|
||
# Exact matching for field values of events. | ||
# Matching for nginx entries: "systemd.unit=nginx" | ||
#include_matches: [] | ||
|
||
# Optional fields that you can specify to add additional information to the | ||
# output. Fields can be scalar values, arrays, dictionaries, or any nested | ||
# combination of these. | ||
#fields: | ||
# env: staging | ||
|
||
|
||
#========================= Journalbeat global options ============================ | ||
#journalbeat: | ||
# Name of the registry file. If a relative path is used, it is considered relative to the | ||
# data path. | ||
#registry_file: registry | ||
|
||
# The number of seconds to wait before trying to read again from journals. | ||
#backoff: 1s | ||
# The maximum number of seconds to wait before attempting to read again from journals. | ||
#max_backoff: 60s | ||
|
||
# Position to start reading from all journal. Possible values: head, tail, cursor | ||
#seek: head | ||
|
||
# Exact matching for field values of events. | ||
# Matching for nginx entries: "systemd.unit=nginx" | ||
#matches: [] |
Oops, something went wrong.