Hello all,
I just update my logstash server from 1.5.4 to 2.3.2. I have to update some config parameters and I am collect log from several file and indexing to elasticsearch.
My problem is when the logstash processs starts it doesn't create sincedb files and this cause data lose.
For instance, if i stop the deamon for a while and i start it again few minutes later, logstash doesn't continue in the line where the process stop, it starts with lastest lines.
This is my logstash configuration:
input {
file {
path => "/var/log/varnish/varnishncsa.log"
type => "varnish"
sincedb_write_interval => "5"
sincedb_path => "/opt/logstash/logs/.since_varnishncsa.log"
}
file {
path => "/var/log/varnish/recovery.log"
type => "varnish"
sincedb_write_interval => "5"
sincedb_path => "/opt/logstash/logs/.since_recovery.log"
}
file {
path => "/var/log/nginx/access.log"
type => "https"
sincedb_write_interval => "5"
sincedb_path => "/opt/logstash/logs/.since_access_nginx.log"
}
}
filter {
if [type] == "varnish" {
grok {
patterns_dir => "/opt/logstash/patterns"
match => { "message" => "(%{IP:clientip}|-) (%{USER:ident}|-) (%{USER:auth}|-) [%{HTTPDATE:timestamp}] "%{WORD:method} http://%{HOSTNAME:vhost}%{URIPATHPARAM:request}([%{WORD:garbage}])? HTTP/%{NUMBER:httpversion}" %{NUMBER:response} (?:%{NUMBER:bytes}|-) %{QS:agent} (%{WORD:cached}|-) %{QS:content_type} %{QS:node} %{NUMBER:response_time} (%{QS:clientid}|-) (%{QS:referer}|-)"}
}
date {
match => ["timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ]
add_tag => [ "dated" ]
}
}
if [type] == "https" {
grok {
patterns_dir => "/opt/logstash/patterns"
match => { "message" => "(%{IP:clientip}|-) (%{USER:ident}|-) (%{USER:auth}|-) \[%{HTTPDATE:timestamp}\] %{HOSTNAME:vhost} \"%{WORD:method} %{URIPATHPARAM:request}(\[%{WORD:garbage}\])? HTTP/%{NUMBER:httpversion}\" %{NUMBER:response} (?:%{NUMBER:bytes}|-) (?:\"(?:%{URI:referrer}|-)\"|%{QS:referrer}) %{QS:agent} (%{QS:clientid}|-)"}
}
date {
match => ["timestamp", "dd/MMM/yyyy:HH:mm:ss Z" ]
add_tag => ["dated"]
}
}
}
output {
elasticsearch {
hosts => ["http://localhost:9200"]
flush_size => "5000"
idle_flush_time => "1"
#index => "logstash-%{index_date}"
index => "logstash-%{+YYYY.MM.dd.HH}"
}
}
Any clue???