Sha256: 36fd4b8a95a94f4ace5cda6fc7714beaa33d9e6a12df607e648e0def624f58a8
Contents?: true
Size: 332 Bytes
Versions: 26
Compression:
Stored size: 332 Bytes
Contents
#!/usr/bin/env ruby require 'rubygems' require 'json' regex = /#{ARGV[0]}/ STDIN.each_line do |line| if line =~ regex object = {} object['timestamp'] = Time.now.tv_sec object['line'] = line.chomp object['match'] = line.scan(regex) puts object.to_json $stderr.puts "\a" end end
Version data entries
26 entries across 26 versions & 1 rubygems