logstash icon indicating copy to clipboard operation
logstash copied to clipboard

Issues with Getting Started on windows

Open ghost opened this issue 12 years ago • 11 comments

I was challenged by @jordansissel via twitter to outline my experiences setting up LogStash. He asked me to create an issue.

First off, I suspect that most of my problems come from using Windows. I was following directions:

> cd logstash-1.4.1
> bin/logstash -e 'input { stdin { } } output { stdout {} }' 
No such command "-e"
Usage: logstash <command> [command args]
Run a command with the --help flag to see the arguments.
For example: logstash agent --help

Available commands:
  agent - runs the logstash agent
  version - emits version info about this logstash
  web - runs the logstash web ui (called Kibana)
  rspec - runs tests

Ok, no problem, I think "agent" is what I want:

> bin/logstash agent -e 'input { stdin { } } output { stdout {} }' 
No such command "{"

Hmm... maybe there are quoting problems with windows. Let's see if there is a way to pass the config via file:

> echo input { stdin { } } output { stdout {} } > config.txt
> bin/logstash agent -f config.txt

Well, there's no output, but the getting started tells me I can type into stdout and see messages. Cool. But, what about this Kibana thing? I can do logstash.bat web, but it doesn't tell me what port it's running on.

I receive a suggestion that there's a one liner to start everything! Cool:

> bin\logstash agent -e 'output { elasticsearch { embedded => true } }' -- web
RubyIO.java:1468:in `fwrite': java.lang.NullPointerException
    from RubyIO.java:1408:in `write'
    from RubyIO$INVOKER$i$1$0$write.gen:-1:in `call'
    from RubyClass.java:690:in `finvoke'
    from Helpers.java:502:in `invoke'
    from RubyBasicObject.java:363:in `callMethod'
    from RubyIO.java:2486:in `write'
    from RubyIO.java:2474:in `putsSingle'
    from RubyIO.java:2403:in `puts1'
    from RubyIO.java:2376:in `puts'
    from RubyIO$INVOKER$i$puts.gen:-1:in `call'
    from CachingCallSite.java:326:in `cacheAndCall'
    from CachingCallSite.java:170:in `call'

Doh. I try all of the above steps with cygwin, and don't have any more luck.

ghost avatar Jun 06 '14 16:06 ghost

First, sorry you're running into these bugs. Second, thanks for filing with all these delicious details!

For sure all of these are windows related, and full confession I don't personally test on windows very frequently. However, it is very important to me that we are successful on windows, so we are working on improving our test infrastructure to make sure we can isolate these environmental problems and fix them!

jordansissel avatar Jun 06 '14 19:06 jordansissel

No problem. Better to make a bug report than complain that it doesn't work! Anyway, if there are eventually new builds to try, I would not mind testing.

ghost avatar Jun 09 '14 15:06 ghost

Hi Jordan and 16bytes, I ran into the same scenario while running logstash on win7 + jre1.6 and win8 + jre1.6/1.7. Do you have any news on this issue?

makotoiguchi avatar Jul 18 '14 20:07 makotoiguchi

Hi Jordan and 16bytes, I finally got logstash to run on Win8 + jre1.7. I ran logstash.bat from the bin folder, using admin privileges:

C:\logstash-1.4.1\bin> logstash.bat agent -f test.conf

where test.conf is:

input {
    stdin {
        type => "stdin-type"
    }
}

output {
    stdout {
        codec => rubydebug
    }
}

I haven't tested using cygwin though.

makotoiguchi avatar Jul 18 '14 21:07 makotoiguchi

makotoiguchi Thanks alot this helped me. Was trying to find a way to run the logstash in windows.

spangul avatar Nov 06 '14 20:11 spangul

Ditto, Thanks for the help makitoiguchi

gershonsherman avatar Dec 25 '14 10:12 gershonsherman

Ran into the same issue but I actually got Logstash to run without the 'fwrite' exception when I ran it from Cygwin:

cat logs | /cygdrive/c/work/logstash-1.4.2/bin/logstash.bat agent -f logstash/complete.conf

peterskim12 avatar Feb 11 '15 21:02 peterskim12

thank you @16bytes for this report.

With the latest version from the master branch on Windows 2008, java version "1.7.0_75" and running under administrator

tests were made without cygwin

PS C:\Users\Administrator\logstash> .\bin\logstash -e 'input { stdin { } } output { stdout {} }'
Logstash startup completed
Hello
2015-02-23T20:16:13.705Z WIN-ISP0U0D3N02 Hello

PS C:\Users\Administrator\logstash> .\bin\logstash agent -e 'input { stdin { } } output { stdout {} }'
Logstash startup completed
Hello
2015-02-23T20:17:07.728Z WIN-ISP0U0D3N02 Hello

Next tests require #2504 to be fixed in a new PR

PS C:\Users\Administrator\logstash> bin\logstash -f .\test.conf
Logstash startup completed
Hello
2015-02-23T20:32:58.572Z WIN-ISP0U0D3N02 Hello
PS C:\Users\Administrator\logstash> bin\logstash agent -f .\test.conf
Logstash startup completed
hello
2015-02-23T20:34:39.224Z WIN-ISP0U0D3N02 hello
PS C:\Users\Administrator\logstash> cat .\somelogs | bin\logstash agent -f .\test.conf
2015-02-23T20:38:34.241Z WIN-ISP0U0D3N02 Some log
Logstash startup completed
Logstash shutdown completed
PS C:\Users\Administrator\logstash> cat .\somelogs | bin\logstash -f .\test.conf

Concerning kibana, since K4 is now using a nodejs server for the backend we have removed the logstash web command in commit https://github.com/elasticsearch/logstash/commit/3986158baccbbc61b0aa3a06758777e912235d01

ph avatar Feb 23 '15 21:02 ph

This command work on windows from a master build.

PS C:\logstash-2.0.0.dev> bin\logstash agent -e 'input { stdin {}} output { elasticsearch { embedded => true } }'
Feb 23, 2015 9:18:49 PM org.elasticsearch.node.internal.InternalNode <init>
INFO: [Super Sabre] version[1.4.0], pid[2392], build[bc94bd8/2014-11-05T14:26:12Z]
Feb 23, 2015 9:20:41 PM org.elasticsearch.node.internal.InternalNode <init>
INFO: [Super Sabre] initializing ...
Feb 23, 2015 9:20:41 PM org.elasticsearch.plugins.PluginsService <init>
INFO: [Super Sabre] loaded [cloud-aws], sites []

[...]

ph avatar Feb 23 '15 21:02 ph

I did a few more tests and I cannot reproduce the RubyIO.java error in the latest version or 1.4.2, I had a few inline parsing errors in 1.4.2 but they all seem to be fixed in the master branch.

ph avatar Feb 23 '15 22:02 ph

Thanks Pier

From: Pier-Hugues Pellerin [mailto:[email protected]] Sent: Monday, February 23, 2015 4:06 PM To: elasticsearch/logstash Cc: Panguluri, Sreeharsha Subject: Re: [logstash] Issues with Getting Started on windows (#1426)

I did a few more tests and I cannot reproduce the RubyIO.java error in the latest version or 1.4.2, I had a few inline parsing errors in 1.4.2 but they all seem to be fixed in the master branch.

— Reply to this email directly or view it on GitHubhttps://github.com/elasticsearch/logstash/issues/1426#issuecomment-75647124.

This e-mail, including attachments, may include confidential and/or proprietary information, and may be used only by the person or entity to which it is addressed. If the reader of this e-mail is not the intended recipient or his or her authorized agent, the reader is hereby notified that any dissemination, distribution or copying of this e-mail is prohibited. If you have received this e-mail in error, please notify the sender by replying to this message and delete this e-mail immediately.

spangul avatar Feb 23 '15 22:02 spangul