Hi,
Newbie here, just installed Logstash, have 2 questions.
- I follow this step, https://www.elastic.co/guide/en/logstash/5.0/config-examples.html, run in command line and working.
[/opt/logstash]$ bin/logstash -f /opt/logstash/logstash-access_log.conf
Settings: Default pipeline workers: 2
Pipeline main started
{
"message" => "x.x.x.x - - [17/Oct/2016:16:45:01 +0800] "GET /KG HTTP/1.1" 302 -",
"@version" => "1",
"@timestamp" => "2016-10-17T09:02:42.609Z",
"path" => "/myapp/logs/access_log.2016-10-17.txt",
"host" => "ip-y.y.y.y",
"type" => "apache_access"
I copied the logstash-access_log.conf into /etc/logstash/conf.d/logstash.conf (just rename into another file).
$ diff /opt/logstash/logstash-access_log.conf /etc/logstash/conf.d/logstash.conf | wc -l
0
But when I start logstash as a service, service logstash st,art, it doesn't send any data at all and the logs only show below,
[/var/log/logstash]$ cat *
{:timestamp=>"2016-10-17T11:53:29.162000+0800", :message=>"Pipeline main started"}
{:timestamp=>"2016-10-17T14:57:02.191000+0800", :message=>"SIGTERM received. Shutting down the agent.", :level=>:warn}
{:timestamp=>"2016-10-17T14:57:02.193000+0800", :message=>"stopping pipeline", :id=>"main"}
{:timestamp=>"2016-10-17T14:57:02.705000+0800", :message=>"Pipeline main has been shutdown"}
{:timestamp=>"2016-10-17T16:49:18.867000+0800", :message=>"Pipeline main started"}
{:timestamp=>"2016-10-17T17:00:01.734000+0800", :message=>"SIGTERM received. Shutting down the agent.", :level=>:warn}
{:timestamp=>"2016-10-17T17:00:01.736000+0800", :message=>"stopping pipeline", :id=>"main"}
{:timestamp=>"2016-10-17T17:00:02.033000+0800", :message=>"Pipeline main has been shutdown"}
Sending logstash logs to /var/log/logstash/logstash.log.
{:timestamp=>"2016-10-17T16:49:18.867000+0800", :message=>"Pipeline main started"}
{:timestamp=>"2016-10-17T17:00:01.736000+0800", :message=>"stopping pipeline", :id=>"main"}
{:timestamp=>"2016-10-17T17:00:02.033000+0800", :message=>"Pipeline main has been shutdown"}
[/var/log/logstash]$ ls -ltr
total 8
-rw-r--r-- 1 root root 0 Oct 17 16:49 logstash.err
-rw-r--r-- 1 root root 325 Oct 17 17:00 logstash.stdout
-rw-r--r-- 1 logstash logstash 774 Oct 17 17:00 logstash.log
What's wrong?
- The input log contains date which is rolling daily. How to make it auto update in configuration file? I tried to make like "/mylog/logs/access_log.
date +"%Y-%m-%d"
.txt" is not working.
input {
file {
path => "/mylog/logs/access_log.2016-10-17.txt"
start_position => "beginning"
}
}