log2json 0.1.6 → 0.1.7

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.
Files changed (3) hide show
  1. data/bin/tail-log.sh +9 -11
  2. data/log2json.gemspec +1 -1
  3. metadata +2 -2
data/bin/tail-log.sh CHANGED
@@ -27,10 +27,6 @@ IFS=$OIFS
27
27
  SINCEDB_DIR=${SINCEDB_DIR:-~/.tail-log}
28
28
  mkdir -p "$SINCEDB_DIR" || true
29
29
 
30
- # Whether to tail from the end instead of from the first line when there's record
31
- # of the file in SINCEDB.
32
- SINCE_EOF=${SINCE_EOF:-""}
33
-
34
30
  # Helper to build the arguments to tail.
35
31
  # Specifically, we expect the use of GNU tail as found in GNU coreutils.
36
32
  # It allows us to follow(with -F) files across rotations or truncations.
@@ -54,13 +50,15 @@ build_tail_args() {
54
50
  continue
55
51
  fi
56
52
  fi
57
- if [ ! "$SINCE_EOF" ]; then
58
- TAIL_ARGS[$((i++))]="-n+$(($(wc -l "$fpath" | cut -d' ' -f1) + 1))"
59
- # Note: we can't just ask tail to seek to the end here(ie, with -n0) since
60
- # then we'd lose track of the line count.
61
- # Note: if fpath doesn't exist yet, then the above evaluates to "-n+1", which
62
- # is fine.
63
- fi
53
+
54
+ # at this point, no last position was recorded in the SINCEDB for fpath,
55
+ # in this case we'd tail from the end of file.
56
+
57
+ TAIL_ARGS[$((i++))]="-n+$(($(wc -l "$fpath" | cut -d' ' -f1) + 1))"
58
+ # Note: we can't just ask tail to seek to the end here(ie, with -n0) since
59
+ # then we'd lose track of the line count.
60
+ # Note: if fpath doesn't exist yet, then the above evaluates to "-n+1", which
61
+ # is fine.
64
62
  TAIL_ARGS[$((i++))]=$fpath
65
63
  done
66
64
  }
data/log2json.gemspec CHANGED
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'log2json'
3
- s.version = '0.1.6'
3
+ s.version = '0.1.7'
4
4
  s.summary = "Read, filter and ship logs. ie, poor man's roll-your-own, light-weight logstash replacement."
5
5
  s.description = IO.read(File.join(File.dirname(__FILE__), 'README'))
6
6
  s.authors = ['Jack Kuan']
metadata CHANGED
@@ -5,8 +5,8 @@ version: !ruby/object:Gem::Version
5
5
  segments:
6
6
  - 0
7
7
  - 1
8
- - 6
9
- version: 0.1.6
8
+ - 7
9
+ version: 0.1.7
10
10
  platform: ruby
11
11
  authors:
12
12
  - Jack Kuan