Having problem enable logstash to talk to redis


#1

Hi, i installed logstash as a shipper on a window box with the help of nssm, and configured as below:
input {
file {
type => "autolog"
path => "E:/elkcluster/log"
}
}
output {
redis {
host => "xxx.xxx.xxx.xxx"
port => 6379
data_type => "list"
key => "dummy"
}
}

Redis is on a linux box, and started with default ports. Below is its logging, looks ok to me.
4554:M 15 Jul 15:35:58.677 # Server started, Redis version 3.0.2
4554:M 15 Jul 15:35:58.678 * DB loaded from disk: 0.000 seconds
4554:M 15 Jul 15:35:58.678 * The server is now ready to accept connections on port 6379

I've placed one dummy log file (with two lines: testing, hello world!) in the e:/elkcluster/log folder, but it's seems nothing is going on between the logstash and redis. I'm not sure what went wrong, please help.


(Magnus B├Ąck) #2

By default Logstash tails the input files. What happens if you append a line to the logfile with echo foo >> E:\elkcluster\log ?


#3

i don't see any log update at redis side
logstash logging doesn't show anything related to processing the file..
last few lines of the logstash logging
{:timestamp=>"2015-07-15T16:11:26.306000+0800", :message=>"_discover_file_glob: E:/elkcluster/log: glob is: ["E:/elkcluster/log"]", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/filewatch-0.6.4/lib/filewatch/watch.rb", :line=>"132", :method=>"_discover_file"}
{:timestamp=>"2015-07-15T16:11:41.306000+0800", :message=>"_discover_file_glob: E:/elkcluster/log: glob is: ["E:/elkcluster/log"]", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/filewatch-0.6.4/lib/filewatch/watch.rb", :line=>"132", :method=>"_discover_file"}
{:timestamp=>"2015-07-15T16:11:56.321000+0800", :message=>"_discover_file_glob: E:/elkcluster/log: glob is: ["E:/elkcluster/log"]", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/filewatch-0.6.4/lib/filewatch/watch.rb", :line=>"132", :method=>"_discover_file"}
{:timestamp=>"2015-07-15T16:12:11.321000+0800", :message=>"_discover_file_glob: E:/elkcluster/log: glob is: ["E:/elkcluster/log"]", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/filewatch-0.6.4/lib/filewatch/watch.rb", :line=>"132", :method=>"_discover_file"}
{:timestamp=>"2015-07-15T16:12:26.321000+0800", :message=>"_discover_file_glob: E:/elkcluster/log: glob is: ["E:/elkcluster/log"]", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/filewatch-0.6.4/lib/filewatch/watch.rb", :line=>"132", :method=>"_discover_file"}


#4

adding log during logstash startup
{:timestamp=>"2015-07-15T15:52:10.813000+0800", :message=>"Reading config file", :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/agent.rb", :level=>:debug, :line=>"295", :method=>"local_config"}
{:timestamp=>"2015-07-15T15:52:10.860000+0800", :message=>"Compiled pipeline code:
inputs = []
filters = []
outputs = []
periodic_flushers = []
shutdown_flushers = []

      input_file_1 = plugin(\"input\", \"file\", LogStash::Util.hash_merge_many({ \"type\" => (\"autolog\") }, { \"path\" => (\"E:/elkcluster/log\") }))

      inputs << input_file_1

      output_redis_2 = plugin(\"output\", \"redis\", LogStash::Util.hash_merge_many({ \"host\" => (\"xxx.xxx.xxx.xxx\") }, { \"port\" => 6379 }, { \"data_type\" => (\"list\") }, { \"key\" => (\"dummy\") }))

      outputs << output_redis_2

def filter_func(event)
events = [event]
logger.debug? && logger.debug("filter received", :event => event.to_hash)
events
end
def output_func(event)
logger.debug? && logger.debug("output received", :event => event.to_hash)
output_redis_2.handle(event)

end", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/pipeline.rb", :line=>"28", :method=>"initialize"}
{:timestamp=>"2015-07-15T15:52:10.907000+0800", :message=>"Plugin not defined in namespace, checking for plugin file", :type=>"input", :name=>"file", :path=>"logstash/inputs/file", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/plugin.rb", :line=>"133", :method=>"lookup"}
{:timestamp=>"2015-07-15T15:52:10.938000+0800", :message=>"Plugin not defined in namespace, checking for plugin file", :type=>"codec", :name=>"plain", :path=>"logstash/codecs/plain", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/plugin.rb", :line=>"133", :method=>"lookup"}
{:timestamp=>"2015-07-15T15:52:10.954000+0800", :message=>"config LogStash::Codecs::Plain/charset = "UTF-8"", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:10.954000+0800", :message=>"config LogStash::Inputs::File/type = "autolog"", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:10.969000+0800", :message=>"config LogStash::Inputs::File/path = ["E:/elkcluster/log"]", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:10.969000+0800", :message=>"config LogStash::Inputs::File/debug = false", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:10.969000+0800", :message=>"config LogStash::Inputs::File/codec = <LogStash::Codecs::Plain charset=>"UTF-8">", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}

{:timestamp=>"2015-07-15T15:52:10.969000+0800", :message=>"config LogStash::Inputs::File/add_field = {}", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:10.985000+0800", :message=>"config LogStash::Inputs::File/stat_interval = 1", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:10.985000+0800", :message=>"config LogStash::Inputs::File/discover_interval = 15", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:10.985000+0800", :message=>"config LogStash::Inputs::File/sincedb_write_interval = 15", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.001000+0800", :message=>"config LogStash::Inputs::File/start_position = "end"", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.001000+0800", :message=>"config LogStash::Inputs::File/delimiter = "
"", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.001000+0800", :message=>"Plugin not defined in namespace, checking for plugin file", :type=>"output", :name=>"redis", :path=>"logstash/outputs/redis", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/plugin.rb", :line=>"133", :method=>"lookup"}
{:timestamp=>"2015-07-15T15:52:11.032000+0800", :message=>"config LogStash::Codecs::Plain/charset = "UTF-8"", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.048000+0800", :message=>"config LogStash::Outputs::Redis/host = ["xxx.xxx.xxx.xxx"]", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.048000+0800", :message=>"config LogStash::Outputs::Redis/port = 6379", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.048000+0800", :message=>"config LogStash::Outputs::Redis/data_type = "list"", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.063000+0800", :message=>"config LogStash::Outputs::Redis/key = "dummy"", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.063000+0800", :message=>"config LogStash::Outputs::Redis/type = """, :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.063000+0800", :message=>"config LogStash::Outputs::Redis/tags = []", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.063000+0800", :message=>"config LogStash::Outputs::Redis/exclude_tags = []", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.063000+0800", :message=>"config LogStash::Outputs::Redis/codec = <LogStash::Codecs::Plain charset=>"UTF-8">", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.079000+0800", :message=>"config LogStash::Outputs::Redis/workers = 1", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.079000+0800", :message=>"config LogStash::Outputs::Redis/name = "default"", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.094000+0800", :message=>"config LogStash::Outputs::Redis/shuffle_hosts = true", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.094000+0800", :message=>"config LogStash::Outputs::Redis/db = 0", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.094000+0800", :message=>"config LogStash::Outputs::Redis/timeout = 5", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.094000+0800", :message=>"config LogStash::Outputs::Redis/batch = false", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.110000+0800", :message=>"config LogStash::Outputs::Redis/batch_events = 50", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.110000+0800", :message=>"config LogStash::Outputs::Redis/batch_timeout = 5", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.110000+0800", :message=>"config LogStash::Outputs::Redis/reconnect_interval = 1", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.110000+0800", :message=>"config LogStash::Outputs::Redis/congestion_threshold = 0", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.110000+0800", :message=>"config LogStash::Outputs::Redis/congestion_interval = 1", :level=>:debug, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/config/mixin.rb", :line=>"112", :method=>"config_init"}
{:timestamp=>"2015-07-15T15:52:11.610000+0800", :message=>"Registering file input", :path=>["E:/elkcluster/log"], :level=>:info, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-file-1.0.0/lib/logstash/inputs/file.rb", :line=>"76", :method=>"register"}
{:timestamp=>"2015-07-15T15:52:11.610000+0800", :message=>"No sincedb_path set, generating one based on the file path", :sincedb_path=>"C:\Windows\system32\config\systemprofile/.sincedb_ba56d7ca5708a0f25f390c193c159995", :path=>["E:/elkcluster/log"], :level=>:info, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-input-file-1.0.0/lib/logstash/inputs/file.rb", :line=>"119", :method=>"register"}
{:timestamp=>"2015-07-15T15:52:11.704000+0800", :message=>"Pipeline started", :level=>:info, :file=>"/elkcluster/logstash/vendor/bundle/jruby/1.9/gems/logstash-core-1.5.2.2-java/lib/logstash/pipeline.rb", :line=>"86", :method=>"run"}


(system) #5