fluent-plugin-systemd 0.0.1 → 0.0.2
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +8 -6
- data/fluent-plugin-systemd.gemspec +1 -1
- data/lib/fluent/plugin/in_systemd.rb +4 -2
- metadata +2 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 7b6d6e4b40b45d982559089fe27d8bdb85f0939c
|
4
|
+
data.tar.gz: d35ef40bc4cf5d20861b44abb5341846ee064deb
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 565a8b206ec54735154ee6a66c53cfdd61fe8ed11d4ffb1c05bbc327b31b17b08c2adfac5e56f3fdcabef55cb50bc2eaf5459ce2256cb4750a5084c025efc56e
|
7
|
+
data.tar.gz: 24deecc1bcc87379fb7e5461cd2ffb51350166a78722c4d4d4d3d4d2120ecda0f15cbfcdd58dc4b849e3cb7e9196a8588618080e1fc2a843cfcf299633121fa6
|
data/README.md
CHANGED
@@ -1,9 +1,6 @@
|
|
1
1
|
# systemd input plugin for [Fluentd](http://github.com/fluent/fluentd)
|
2
2
|
|
3
|
-
[
|
4
|
-
alt="Build Status" />](https://travis-ci.org/reevoo/fluent-plugin-systemd) [<img
|
5
|
-
src="https://codeclimate.com/github/reevoo/fluent-plugin-systemd/badges/gpa.svg"
|
6
|
-
/>](https://codeclimate.com/github/reevoo/fluent-plugin-systemd)
|
3
|
+
[![Build Status](https://travis-ci.org/reevoo/fluent-plugin-systemd.svg?branch=master)](https://travis-ci.org/reevoo/fluent-plugin-systemd) [![Code Climate GPA](https://codeclimate.com/github/reevoo/fluent-plugin-systemd/badges/gpa.svg)](https://codeclimate.com/github/reevoo/fluent-plugin-systemd) [![Gem Version](https://badge.fury.io/rb/fluent-plugin-systemd.svg)](https://rubygems.org/gems/fluent-plugin-systemd)
|
7
4
|
|
8
5
|
## Overview
|
9
6
|
|
@@ -40,7 +37,7 @@ Path to the systemd journal, defaults to `/var/log/journal`
|
|
40
37
|
|
41
38
|
**filters**
|
42
39
|
|
43
|
-
Array of filters, see [here](http://www.rubydoc.info/gems/systemd-journal/Systemd%2FJournal%2FFilterable%3Afilter) for
|
40
|
+
Array of filters, see [here](http://www.rubydoc.info/gems/systemd-journal/Systemd%2FJournal%2FFilterable%3Afilter) for further
|
44
41
|
documentation, defaults to no filtering.
|
45
42
|
|
46
43
|
**pos file**
|
@@ -49,9 +46,14 @@ Path to pos file, stores the journald cursor. File is created if does not exist.
|
|
49
46
|
|
50
47
|
**read_from_head**
|
51
48
|
|
52
|
-
If true reads all
|
49
|
+
If true reads all available journal from head, otherwise starts reading from tail,
|
53
50
|
ignored if pos file exists. Defaults to false.
|
54
51
|
|
52
|
+
**strip_underscores**
|
53
|
+
|
54
|
+
If true strips underscores from the beginning of systemds field names.
|
55
|
+
May be useful if outputting to kibana, as underscore prefixed fields are unindexed there.
|
56
|
+
|
55
57
|
**tag**
|
56
58
|
|
57
59
|
Required the tag for events generated by this input plugin.
|
@@ -9,6 +9,7 @@ module Fluent
|
|
9
9
|
config_param :filters, :array, default: []
|
10
10
|
config_param :pos_file, :string, default: nil
|
11
11
|
config_param :read_from_head, :bool, default: false
|
12
|
+
config_param :strip_underscores, :bool, default: false
|
12
13
|
config_param :tag, :string
|
13
14
|
|
14
15
|
attr_reader :tag
|
@@ -37,7 +38,7 @@ module Fluent
|
|
37
38
|
|
38
39
|
private
|
39
40
|
|
40
|
-
attr_reader :journal, :running, :lock, :cursor, :path, :pos_writer
|
41
|
+
attr_reader :journal, :running, :lock, :cursor, :path, :pos_writer, :strip_underscores
|
41
42
|
|
42
43
|
def run
|
43
44
|
watch do |entry|
|
@@ -46,7 +47,8 @@ module Fluent
|
|
46
47
|
end
|
47
48
|
|
48
49
|
def formatted(entry)
|
49
|
-
entry.to_h
|
50
|
+
return entry.to_h unless strip_underscores
|
51
|
+
Hash[entry.to_h.map { |k, v| [k.gsub(/\A_+/, ''), v] }]
|
50
52
|
end
|
51
53
|
|
52
54
|
def watch
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: fluent-plugin-systemd
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0.
|
4
|
+
version: 0.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Ed Robinson
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-11-
|
11
|
+
date: 2015-11-10 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: bundler
|