Logstash doesn't work with my config file; it throws error when it is parsing the config file

Description

I tried to run Logstash as the server with the config file and it threw out this error:

jon1984@ubuntu:~/Applications/logstash_conf$ java -jar logstash-1.1.0-monolithic.jar agent -f agent-server.conf
I, [2012-02-19T20:14:36.427000 #2597] INFO – : Using beta plugin 'amqp'. For more information about plugin statuses, see http://logstash.net/docs/1.1.0/plugin-status {"timestamp":"2012-02-19T20:14:36.409000 -0800","message":"Using beta plugin 'amqp'. For more information about plugin statuses, see http://logstash.net/docs/1.1.0/plugin-status ","level":"info"}
E, [2012-02-19T20:14:36.439000 #2597] ERROR – : Unknown setting 'exchange_type' for input/amqp {"timestamp":"2012-02-19T20:14:36.438000 -0800","message":"Unknown setting 'exchange_type' for input/amqp","level":"error"}
E, [2012-02-19T20:14:36.441000 #2597] ERROR – : Config validation failed. {"timestamp":"2012-02-19T20:14:36.440000 -0800","message":"Config validation failed.","level":"error"}
Exception in thread "LogStash::Agent" org.jruby.exceptions.RaiseException: (SystemExit) exit
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:867)
at org.jruby.RubyKernel.exit(org/jruby/RubyKernel.java:836)
at LogStash::Config::Mixin.config_init(file:/home/jon1984/Applications/logstash_conf/logstash-1.1.0-monolithic.jar!/logstash/config/mixin.rb:49)
at LogStash::Inputs::Base.initialize(file:/home/jon1984/Applications/logstash_conf/logstash-1.1.0-monolithic.jar!/logstash/inputs/base.rb:57)
at LogStash::Inputs::Amqp.initialize(file:/home/jon1984/Applications/logstash_conf/logstash-1.1.0-monolithic.jar!/logstash/inputs/amqp.rb:77)
at LogStash::Agent.parse_config(file:/home/jon1984/Applications/logstash_conf/logstash-1.1.0-monolithic.jar!/logstash/agent.rb:267)
at LogStash::Config::File.parse(file:/home/jon1984/Applications/logstash_conf/logstash-1.1.0-monolithic.jar!/logstash/config/file.rb:48)
at LogStash::Config::File.each(file:/home/jon1984/Applications/logstash_conf/logstash-1.1.0-monolithic.jar!/logstash/config/file.rb:86)
at org.jruby.RubyArray.each(org/jruby/RubyArray.java:1612)
at LogStash::Config::File.each(file:/home/jon1984/Applications/logstash_conf/logstash-1.1.0-monolithic.jar!/logstash/config/file.rb:85)
at org.jruby.RubyHash.each(org/jruby/RubyHash.java:1175)
at LogStash::Config::File.each(file:/home/jon1984/Applications/logstash_conf/logstash-1.1.0-monolithic.jar!/logstash/config/file.rb:78)
at LogStash::Config::File.parse(file:/home/jon1984/Applications/logstash_conf/logstash-1.1.0-monolithic.jar!/logstash/config/file.rb:34)
at LogStash::Agent.parse_config(file:/home/jon1984/Applications/logstash_conf/logstash-1.1.0-monolithic.jar!/logstash/agent.rb:257)
at LogStash::Agent.run_with_config(file:/home/jon1984/Applications/logstash_conf/logstash-1.1.0-monolithic.jar!/logstash/agent.rb:341)
at LogStash::Agent.run_with_config(file:/home/jon1984/Applications/logstash_conf/logstash-1.1.0-monolithic.jar!/logstash/agent.rb:340)
at LogStash::Agent.run(file:/home/jon1984/Applications/logstash_conf/logstash-1.1.0-monolithic.jar!/logstash/agent.rb:304)

My agent-server.conf file are as follows:
input {
amqp {

  1. ship logs to the 'rawlogs' fanout queue.
    type => "all"
    #type => "apache-access"
    host => "172.17.112.98"
    exchange_type => "fanout"
    name => "rawlogs"
    }
    #amqp {

  2. ship logs to the 'rawlogs' fanout queue.

  3. type => "all"
    #type => "apache-access"

  4. host => "10.19.200.181"

  5. port => "5672"

  6. exchange_type => "fanout"

  7. name => "rawlogs"
    #}
    }

filter {
grok {
type => "syslog" # for logs of type "syslog"
pattern => "%{SYSLOGLINE}"

  1. You can specify multiple 'pattern' lines
    }

grok {
type => "apache-access" # for logs of type 'apache-access'
pattern => "%{COMBINEDAPACHELOG}"
}

  1. date {

  2. type => "syslog"

  1. The 'timestamp' and 'timestamp8601' names are for fields in the

  2. logstash event. The 'SYSLOGLINE' grok pattern above includes a field

  3. named 'timestamp' that is set to the normal syslog timestamp if it

  4. exists in the event.

  5. timestamp => "MMM d HH:mm:ss" # syslog 'day' value can be space-leading

  6. timestamp => "MMM dd HH:mm:ss"

  7. timestamp8601 => ISO8601 # Some syslogs use ISO8601 time format

  8. }

date {
type => "apache-access"
timestamp => "dd/MMM/yyyy:HH:mm:ss Z"
}
}

output {
stdout { }

  1. If your elasticsearch server is discoverable with multicast, use this:

  2. elasticsearch { }

  1. If you can't discover using multicast, set the address explicitly
    elasticsearch {
    host => "172.17.112.98"
    port => "9300"
    cluster => "elasticsearch"
    }
    #elasticsearch { embedded => true }
    }

I can't see why there is an unknown setting for exchange_type when it is the usual fanout.

Also, I am running a separate instance of Elastic Seach to index my logs, and so I am wondering if I just ran the java file as it is with the above config, will logstash be able to connect to the Elastic Search instance? I remember doing a "CLASSPATH=$(ls /home/seoadmin/Applications/elasticsearch-0.17.6/lib/*.jar | tr '\n' ':') logstash -f agent-server2.conf" to connect the elastic search with Logstash.

Please correct me if I am getting anything wrong. Thanks!

Regards,
Jonathan

Assignee

Logstash Developers

Reporter

Jonathan Moo

Labels

None

Affects versions

Configure