Sha256: b06a9348753e689cfcbb099955ece9c98a01b53052c526768c1c86950617bc1a

Contents?: true

Size: 458 Bytes

Versions: 2

Compression:

Stored size: 458 Bytes

Contents

require 'socket'

class Woodchuck::Input

  def create(path, line)
		Woodchuck::Event.new(prepare_hash(path, line))
	end

	protected

	def prepare_hash(path, line)
		host = Socket.gethostname

		{
			:source_path => path,
			:line => line,
			:source_host => host,
			:timestamp => Time.now.utc.iso8601(6),
			:source => Addressable::URI.new(:scheme => 'file', :host => host, :path => path),
			:type => 'file',
			:fields => {},
			:tags => []
		}
	end
end

Version data entries

2 entries across 2 versions & 1 rubygems

Version Path
woodchuck-json-event-0.0.2 lib/woodchuck/input.rb
woodchuck-json-event-0.0.1 lib/woodchuck/input.rb