1
votes

I have setup Logstash and Elastic Search using Homebrew. Logstash takes forever to get connected or to start up. This is the way I start up Logstash (added the protocol from another answer on SO)

logstash -e 'input { udp {port => 5228 codec => json_lines}} output {elasticsearch { host => localhostprotocol => "http"} stdout {codec => rubydebug }}'

I start ES with just elasticsearch and the output I get on Logstash terminal is:

Using milestone 2 input plugin 'udp'. This plugin should be stable, but if you see strange behavior, please let us know! For more information on plugin milestones, see http://logstash.net/docs/1.4.2/plugin-milestones {:level=>:warn}

Nothing ever changes, nor does it get started. I should be receiving a connection added to elastic search but this is what I see on ES windwow:

[2015-03-10 14:02:32,170][INFO ][node                     ] [Hub] version[1.4.4], pid[72525], build[c88f77f/2015-02-19T13:05:36Z]
[2015-03-10 14:02:32,170][INFO ][node                     ] [Hub] initializing
[2015-03-10 14:02:32,173][INFO ][plugins                  ] [Hub] loaded [], sites []
[2015-03-10 14:02:33,725][INFO ][node                     ] [Hub] initialized
[2015-03-10 14:02:33,725][INFO ][node                     ] [Hub] starting
[2015-03-10 14:02:33,774][INFO ][transport                ] [Hub] bound_address {inet[/127.0.0.1:9300]}, publish_address {inet[/127.0.0.1:9300]}
[2015-03-10 14:02:33,787][INFO ][discovery                ] [Hub] elasticsearch_pramesh/5P2E4VDFRFyDAsXOHH-MJw
[2015-03-10 14:02:37,556][INFO ][cluster.service          ] [Hub] new_master [Hub][5P2E4VDFRFyDAsXOHH-MJw][hostname.local][inet[/127.0.0.1:9300]], reason: zen-disco-join (elected_as_master)
[2015-03-10 14:02:37,571][INFO ][http                     ] [Hub] bound_address {inet[/127.0.0.1:9200]}, publish_address {inet[/127.0.0.1:9200]}
[2015-03-10 14:02:37,571][INFO ][node                     ] [Hub] started
[2015-03-10 14:02:37,818][INFO ][gateway                  ] [Hub] recovered [1] indices into cluster_state

Where should I start debugging from? I have tried some suggestions on SO but nothing seems to so as much give me an error, from where I could proceed.

1
Your command doesn't really say host => localhostprotocol, right? Leave out ES for now and just use a stdout output. Verify that you can submit messages via UDP and get them printed to stdout. Then add ES back. If the Logstash log doesn't contain anything up the log verbosity with --verbose or even --debug.Magnus Bäck
Also suggest you throw your config into a file and point to that (logstash -c logstash.conf). It'll make it easier to switch your stdin and stdout on/off as opposed to trying to do it all on command line. Plus generally just make it easier for you to get your head around what the hell is happening. :)Luke Peterson

1 Answers

1
votes

It looks as if you've got a typo there, you need a space between localhost and protocol. However, I'd advise also adding the port as below:

output {
    elasticsearch { host => "localhost" protocol => "http" port =>"9200"} 
    stdout {codec => rubydebug }
}