# Logstash - install & first test

**URL:** <https://discuss.elastic.co/t/logstash-install-first-test/31215>\
**Category:** Logstash\
**Created:** [September 28, 2015, 8:17am UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215 "2015-09-28T08:17:56Z")\
**Posts on this page:** 13\
**Page:** 1

<div class="post-metadata">

**Author:** ![Franck\_Serot](https://avatars.discourse-cdn.com/v4/letter/f/f19dbf/32.png) [@Franck\_Serot](https://discuss.elastic.co/u/Franck_Serot)\
**Post date:** [September 28, 2015, 8:17am UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215/1 "2015-09-28T08:17:57Z")

</div>

Hi,

I try to install and test logstash according to the following tutorial.

[https://www.elastic.co/guide/en/logstash/current/first-event.html](https://www.elastic.co/guide/en/logstash/current/first-event.html)

I have the following error.

java -version

java version "1.8.0\_31"  
Java(TM) SE Runtime Environment (build 1.8.0\_31-b13)  
Java HotSpot(TM) 64-Bit Server VM (build 25.31-b07, mixed mode)

or

java version "1.7.0\_75"  
Java(TM) SE Runtime Environment (build 1.7.0\_75-b13)  
Java HotSpot(TM) 64-Bit Server VM (build 24.75-b04, mixed mode)

cd logstash-1.5.4

.\bin\logstash -e 'input { stdin { } } output { stdout {} }'

Erreur : impossible de trouver ou charger la classe principale org.jruby.Main

Could you help to understand the problem and solve it ?

Best regards,

Franck

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 28, 2015, 8:36am UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215/2 "2015-09-28T08:36:49Z")

</div>

> [@Franck\_Serot](#):
>
> input { stdi { } } output { stdout {} }

Is that a typo, it should be `stdin`.

---

<div class="post-metadata">

**Author:** ![Franck\_Serot](https://avatars.discourse-cdn.com/v4/letter/f/f19dbf/32.png) [@Franck\_Serot](https://discuss.elastic.co/u/Franck_Serot)\
**Post date:** [September 28, 2015, 8:44am UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215/3 "2015-09-28T08:44:26Z")

</div>

No it's not the problem because I tested with stdin instead of stdi.

---

<div class="post-metadata">

**Author:** ![Franck\_Serot](https://avatars.discourse-cdn.com/v4/letter/f/f19dbf/32.png) [@Franck\_Serot](https://discuss.elastic.co/u/Franck_Serot)\
**Post date:** [September 28, 2015, 9:15am UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215/4 "2015-09-28T09:15:01Z")

</div>

I think the problem is jruby because I can't get version of jruby.

D:\bin\logstash-1.5.4\>.\vendor\jruby\bin\jruby -v  
Erreur : impossible de trouver ou charger la classe principale org.jruby.Main

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 28, 2015, 10:13am UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215/5 "2015-09-28T10:13:10Z")

</div>

Shouldn't matter as LS only needs java installed.

---

<div class="post-metadata">

**Author:** ![Franck\_Serot](https://avatars.discourse-cdn.com/v4/letter/f/f19dbf/32.png) [@Franck\_Serot](https://discuss.elastic.co/u/Franck_Serot)\
**Post date:** [September 28, 2015, 2:14pm UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215/6 "2015-09-28T14:14:14Z")

</div>

I find the solution of this problem.

set SCRIPT\_DIR=%~dp0  
set JRUBY\_HOME=%SCRIPT\_DIR%\logstash-1.5.4\vendor\jruby  
logstash-1.5.4\bin\logstash -e 'input { stdin { } } output { stdout {} }'

---

<div class="post-metadata">

**Author:** ![roland](https://avatars.discourse-cdn.com/v4/letter/r/3ab097/32.png) [@roland](https://discuss.elastic.co/u/roland)\
**Post date:** [September 28, 2015, 2:21pm UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215/7 "2015-09-28T14:21:12Z")

</div>

Where did you set those variables?

---

<div class="post-metadata">

**Author:** ![roland](https://avatars.discourse-cdn.com/v4/letter/r/3ab097/32.png) [@roland](https://discuss.elastic.co/u/roland)\
**Post date:** [September 28, 2015, 2:21pm UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215/8 "2015-09-28T14:21:55Z")

</div>

Forget my question, I see you set them just before starting logstash on the command line ☹

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [September 28, 2015, 3:09pm UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215/9 "2015-09-28T15:09:33Z")

</div>

What's the full path to the Logstash binary?

There has been issues in the past when directory names have spaces in them.

---

<div class="post-metadata">

**Author:** ![Franck\_Serot](https://avatars.discourse-cdn.com/v4/letter/f/f19dbf/32.png) [@Franck\_Serot](https://discuss.elastic.co/u/Franck_Serot)\
**Post date:** [September 29, 2015, 7:03am UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215/10 "2015-09-29T07:03:44Z")

</div>

I installed elasticsearch, logstash and kibana in the following directories.  
Then, I created 2 files :

- logstash.cong, logstash configuration file
- start.bat, a bat file who start elasticsearch, logbash and kibana

I think ELK could be started like services but i dont't test this method for the moment.

D:\bin\elk\elasticsearch-1.7.2  
D:\bin\elk\logstash-1.5.4  
D:\bin\elk\kibana-4.1.2-windows  
D:\bin\elk\logstash.conf

input {  
stdin { }  
}  
output {  
elasticsearch {  
host =\> localhost  
}  
}

D:\bin\elk\start.bat  
@echo off

set SCRIPT\_DIR=%~dp0  
set JRUBY\_HOME=%SCRIPT\_DIR%\logstash-1.5.4\vendor\jruby

start elasticsearch-1.7.2\bin\elasticsearch.bat  
SLEEP 10

REM logstash-1.5.4\bin\logstash -e 'input { stdin { } } output { stdout {} }'  
start logstash-1.5.4\bin\logstash -f logstash.conf  
SLEEP 10

start kibana-4.1.2-windows\bin\kibana.bat  
SLEEP 10

---

<div class="post-metadata">

**Author:** ![cinhtau](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/cinhtau/32/40292_2.png) [@cinhtau](https://discuss.elastic.co/u/cinhtau)\
**Post date:** [October 1, 2015, 3:43pm UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215/11 "2015-10-01T15:43:38Z")

</div>

You are in the wrong folder ... that's why you have to set the JRUBY\_HOME

Since you are working under Windows you have to use the bat file

```
cd D:\bin\elk\logstash-1.5.4
bin\logstash.bat --e 'input { stdin { } } output { stdout { codec => "rubydebug" } }'
```

---

<div class="post-metadata">

**Author:** ![Franck\_Serot](https://avatars.discourse-cdn.com/v4/letter/f/f19dbf/32.png) [@Franck\_Serot](https://discuss.elastic.co/u/Franck_Serot)\
**Post date:** [October 2, 2015, 7:11am UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215/12 "2015-10-02T07:11:43Z")

</div>

No, I had the same problem with

cd D:\bin\elk\logstash-1.5.4  
\bin\logstash -e 'input { stdin { } } output { stdout {} }'

And I solved it with

cd D:\bin\elk\logstash-1.5.4  
set JRUBY\_HOME=D:\bin\elk\logstash-1.5.4\vendor\jruby  
\bin\logstash -e 'input { stdin { } } output { stdout {} }'

I created then a directory elk in order to group the directories elastisearch, logstash and kibana.  
The file start.file is just a script to start quickly the 3 applications.

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [July 6, 2017, 5:27am UTC](https://discuss.elastic.co/t/logstash-install-first-test/31215/13 "2017-07-06T05:27:29Z")

</div>


