Logstast apache configuration


(krishna singh) #1

Guysss please help me out...i have created one configuration file with the code

input {
file {
path => "/var/log/messages"
type => "syslog"
}

file {
path => "/var/log/apache/access.log"
type => "apache"
}
}

output {
elasticsearch {
host => localhost
}
stdout { codec => json }
}

It showing me same error again n again.

bin/logstash -f logstash.conf

Error: No config files found: /home/krishna/Downloads/logstash-2.0.0-rc1/logstash.conf
Can you make sure this path is a logstash config file?
You may be interested in the '--configtest' flag which you can
use to validate logstash's configuration before you choose
to restart a running system.


(Mark Walkom) #2

Is that where your config file lives?


(krishna singh) #3

NO,right path is

/home/krishna/Downloads/logstash-2.0.0-rc1/bin/logstash.conf


(Mark Walkom) #4

Pass that in as the full path then :slight_smile:


(krishna singh) #5

I had already passed it but it showing me same error.


(Mark Walkom) #6

bin/logstash -f /home/krishna/Downloads/logstash-2.0.0-rc1/bin/logstash.conf still errors?

What does ls -l /home/krishna/Downloads/logstash-2.0.0-rc1/bin/logstash.conf show?


(krishna singh) #7

-rw-rw-r-- 1 krishna krishna 235 Oct 30 12:34 /home/krishna/Downloads/logstash-2.0.0-rc1/bin/logstash.conf


(Mark Walkom) #8

So bin/logstash -f /home/krishna/Downloads/logstash-2.0.0-rc1/bin/logstash.conf still errors?

It sounds like just a path issue.


(krishna singh) #9

Error: The setting host in plugin elasticsearch is obsolete and is no longer available. Please use the 'hosts' setting instead. You can specify multiple entries separated by comma in 'host:port' format. If you have any questions about this, you are invited to visit https://discuss.elastic.co/c/logstash and ask.
You may be interested in the '--configtest' flag which you can
use to validate logstash's configuration before you choose
to restart a running system.

I got new error.


(Geri Ruccolo) #10

If you have logstash\bin in your path, put your config file into logstash\conf and issue command from there.


(Geri Ruccolo) #11

Oh and forgot to mention that will cut you command down significantly to be logstash -f logstash.conf


(Rene) #12

To solve this, change the output section into this:

 output {
 elasticsearch {
 hosts => localhost
 }
 stdout { codec => json }
}

Small change, but this makes the elasticsearch plugin work again. Don't forget to restart logstash after editing your config file.


(system) #13