fluent-plugin-systemd 0.0.1 → 0.0.2

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 473961511b5ecf9533e4e5276317fcd91553a9b4
4
- data.tar.gz: b340367404c3b3851dcdb720320fb0e2442a6166
3
+ metadata.gz: 7b6d6e4b40b45d982559089fe27d8bdb85f0939c
4
+ data.tar.gz: d35ef40bc4cf5d20861b44abb5341846ee064deb
5
5
  SHA512:
6
- metadata.gz: ba42443dc10da1c1824a73395be4dc82dca01a45eb7a60e8d7455d6fb837b9d491c2c5dcf4c95683c5dadfbe4881e8539812d450aa960ed1ec33f4074c184bc5
7
- data.tar.gz: b1ccb5cb033c495200a500a029e8ad72ab45413d0a4c112c7d7916789fa4e2c80634f4474999f70451288ca08cb5b4cebf648ea0b5f06569b5a1c217c81ede0d
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
- [<img src="https://travis-ci.org/reevoo/fluent-plugin-systemd.svg?branch=master"
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 futher
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 avalible journal from head, otherwise starts reading from tail,
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.
@@ -5,7 +5,7 @@ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
5
5
 
6
6
  Gem::Specification.new do |spec|
7
7
  spec.name = 'fluent-plugin-systemd'
8
- spec.version = '0.0.1'
8
+ spec.version = '0.0.2'
9
9
  spec.authors = ['Ed Robinson']
10
10
  spec.email = ['ed@reevoo.com']
11
11
 
@@ -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.1
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-06 00:00:00.000000000 Z
11
+ date: 2015-11-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler