log2json 0.1.6 → 0.1.7
Sign up to get free protection for your applications and to get access to all the features.
- data/bin/tail-log.sh +9 -11
- data/log2json.gemspec +1 -1
- 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
|
-
|
58
|
-
|
59
|
-
|
60
|
-
|
61
|
-
|
62
|
-
|
63
|
-
|
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.
|
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']
|