logstash-input-remote_proc 0.6.0 → 0.7.0

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: 8104ecd742f611ddf8d1649d610f37cdcfb70b3f
4
- data.tar.gz: 0f22c8b4501afb2779aee032e7a29901f3881e5d
3
+ metadata.gz: 39e455167eaf2062169a3710062f1c8bfbf8ca88
4
+ data.tar.gz: 928f9c46a49aeb73f05328284f7be026523c2c25
5
5
  SHA512:
6
- metadata.gz: 37d86d83e6aefc37b7e10e0e11ffd3c470b0a6d4f0fbfc38dc08941b46f18021602b9d3a887b32625036d2cd27922dfc648b7197be3a3c3082410601be0391b1
7
- data.tar.gz: 49292d4e0474344a127dc1babbb1c32d5589ead59ade9eb7ff0a672d6f869dc7524bbab0baa2ba98bc5506d181f1822927933955a7a39c83d15ad02995cef2e0
6
+ metadata.gz: 900f910091a3e30167ef30ea60fec61c830539810f984d97f7a64f17bdb6a1cd2120bb1974f40310bf70ab9ee0249cf142e249e71640c2ae1bb9a34ab6d873eb
7
+ data.tar.gz: 7535627808c62951d5f553c2661731f84c3fca9591e8455460948c9d764e61b5a642c3c5048a9b199b0e6d8f0b7cb294737f0101a44c1030044ce42458db6595
@@ -271,11 +271,11 @@ module LogStash
271
271
  # Process SYSVIPCSHM data
272
272
  def proc_sysvipcshm(data)
273
273
  return {} unless data
274
- lines = data.split(/$/)
275
- _ = lines.shift # Remove column name line
274
+ lines = data.lines
276
275
  sysvipcshm = {}
277
- lines.each do |l|
278
- t = l.strip.split(/\s+/)
276
+ lines.drop(1).each do |l|
277
+ l.strip!
278
+ t = l.split(/\s+/)
279
279
  next if t.empty? || t.length < 16
280
280
  sysvipcshm[t[1]] = {} # shmid
281
281
  sysvipcshm[t[1]]['key'] = t[0]
@@ -302,10 +302,10 @@ module LogStash
302
302
  return {} unless data
303
303
  crypto = {}
304
304
  current_crypto = ''
305
- data.split(/$/).each do |line|
306
- l = line.strip
307
- next if l.empty?
308
- t = l.split(/\s+:\s+/)
305
+ data.each_line do |line|
306
+ line.strip!
307
+ next if line.empty?
308
+ t = line.split(/\s+:\s+/)
309
309
  next if t.empty? || t.length != 2
310
310
  if 'name'.eql?(t[0])
311
311
  current_crypto = t[1]
@@ -321,8 +321,9 @@ module LogStash
321
321
  def proc_mounts(data)
322
322
  return {} unless data
323
323
  mounts = {}
324
- data.split(/$/).each do |line|
325
- t = line.strip.split(/\s+/)
324
+ data.each_line do |line|
325
+ line.strip!
326
+ t = line.split(/\s+/)
326
327
  next if t.empty? || t.length < 6
327
328
  # mounted device name
328
329
  device = {}
@@ -340,12 +341,11 @@ module LogStash
340
341
  # Process NETWIRELESS data.
341
342
  def proc_netwireless(data)
342
343
  return {} unless data
343
- lines = data.split(/$/)
344
- _ = lines.shift # Remove first line
345
- _ = lines.shift # Remove second line
344
+ lines = data.lines
346
345
  netwireless = {}
347
- lines.each do |l|
348
- t = l.strip.split(/[:\s]+/)
346
+ lines.drop(2).each do |l|
347
+ l.strip!
348
+ t = l.split(/[:\s]+/)
349
349
  next if t.empty? || t.length < 11 # Last column WE22 is often empty
350
350
  netwireless[t[0]] = {}
351
351
  netwireless[t[0]]['status'] = t[1].to_i
@@ -366,12 +366,11 @@ module LogStash
366
366
  # Process NETDEV data.
367
367
  def proc_netdev(data)
368
368
  return {} unless data
369
- lines = data.split(/$/)
370
- _ = lines.shift # Remove first line
371
- _ = lines.shift # Remove second line
369
+ lines = data.lines
372
370
  netdev = {}
373
- lines.each do |l|
374
- t = l.strip.split(/[:\s]+/)
371
+ lines.drop(2).each do |l|
372
+ l.strip!
373
+ t = l.split(/[:\s]+/)
375
374
  next if t.empty? || t.length < 17
376
375
  netdev[t[0]] = {}
377
376
  netdev[t[0]]['rxbytes'] = t[1].to_i
@@ -400,8 +399,9 @@ module LogStash
400
399
  def proc_diskstats(data)
401
400
  return {} unless data
402
401
  diskstats = {}
403
- data.split(/$/).each do |line|
404
- t = line.strip.split(/\s+/)
402
+ data.each_line do |line|
403
+ line.strip!
404
+ t = line.split(/\s+/)
405
405
  next if t.empty? || t.length < 14
406
406
  diskstats[t[2]] = {} # device name
407
407
  diskstats[t[2]]['major number'] = t[0].to_i
@@ -425,7 +425,7 @@ module LogStash
425
425
  def proc_vmstat(data)
426
426
  return {} unless data
427
427
  vmstat = {}
428
- data.split(/$/).each do |line|
428
+ data.each_line do |line|
429
429
  m = /([^\s]+)\s+(\d+)/.match(line)
430
430
  vmstat[m[1]] = m[2].to_i if m && m.length >= 3
431
431
  end
@@ -453,15 +453,12 @@ module LogStash
453
453
  def proc_meminfo(data)
454
454
  return {} unless data
455
455
  meminfo = {}
456
- data.split(/$/).each do |line|
456
+ data.each_line do |line|
457
457
  m = /([^\n\t:]+)\s*:\s+(\d+)(\skb)?$/i.match(line)
458
458
  next unless m
459
459
  meminfo[m[1]] = m[2].to_i
460
460
  meminfo[m[1]] *= 1000 if m[3] # m[3] is not nil if `/KB/i` is found
461
461
  end
462
- unless meminfo.empty?
463
- meminfo['CalcMemUsed'] = meminfo['MemTotal'] - meminfo['MemFree']
464
- end
465
462
  meminfo
466
463
  end
467
464
 
@@ -470,7 +467,7 @@ module LogStash
470
467
  def proc_stat(data)
471
468
  return {} unless data
472
469
  stat = {}
473
- data.split(/$/).each do |line|
470
+ data.each_line do |line|
474
471
  m = /^(cpu[0-9]*|intr|ctxt|btime|processes|procs_running|procs_blocked|softirq)\s+(.*)$/i.match(line)
475
472
  next unless m
476
473
  if m[1] =~ /^cpu[0-9]*/i
@@ -507,8 +504,9 @@ module LogStash
507
504
  return {} unless data
508
505
  cpuinfo = {} # TODO(fenicks): change to array
509
506
  num_cpu = 0
510
- data.split(/$/).each do |line|
511
- next if line.strip.empty?
507
+ data.each_line do |line|
508
+ line.strip!
509
+ next if line.empty?
512
510
  m = /([^\n\t:]+)\s*:\s+(.+)$/.match(line)
513
511
  next unless m
514
512
  # Apply filters
@@ -1,6 +1,6 @@
1
1
  Gem::Specification.new do |s|
2
2
  s.name = 'logstash-input-remote_proc'
3
- s.version = '0.6.0'
3
+ s.version = '0.7.0'
4
4
  s.licenses = ['Apache-2.0']
5
5
  s.summary = 'This Logstash plugin collects PROCFS metrics through remote SSH servers.'
6
6
  s.description = 'This gem is a Logstash plugin required to be installed on top of the Logstash core pipeline using $LS_HOME/bin/logstash-plugin install gemname. This gem is not a stand-alone program'
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: logstash-input-remote_proc
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.6.0
4
+ version: 0.7.0
5
5
  platform: ruby
6
6
  authors:
7
7
  - Christian Kakesa
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2016-12-09 00:00:00.000000000 Z
11
+ date: 2016-12-10 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  requirement: !ruby/object:Gem::Requirement