Hi, I want to send log lines to elastic with logstash. I'm burning hours and can't get it right.
My log lines all look like:
yyyymmdd hh:mm:ss ev:1 rn:3
(like : 20170312 14:03:55 ev:1 rn:5 etc. etc.)
In patterns_dir I defined the file waxtimestamp with:
WAXTIMESTAMP %{YEAR}%{MONTHNUM}%{MONTHDAY} %{TIME}
In my filter.conf I have:
input {
file {
path => ["/var/log/wax/main.log"]
type => "wax"
}
}
filter {
grok {
patterns_dir => ["./patterns"]
match => { "message" => "%{WAXTIMESTAMP:datetime} %{GREEDYDATA:message}" }
}
date {
match => { "datetime" => "yyyyMMdd HH:mm:ss" }
target => "@timestamp"
}
}
output {
elasticsearch {
hosts => ["elastichost:9200"]
index => "wax-%{+YYYY.MM.dd}"
}
stdout { codec => rubydebug }
}
What am I doing wrong?
In my logstash log I get:
[............]
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@patterns_dir = ["./patterns"]
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@match = {"message"=>"%{WAXTIMESTAMP:datetime} %{GREEDYDATA:message}"}
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@id = "5b5d9ebf8eb9cb9e2cd333d92e43b66b76587dab67f16ef87ac31e9906e94a76"
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@enable_metric = true
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@add_tag = []
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@remove_tag = []
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@add_field = {}
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@remove_field = []
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@periodic_flush = false
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@pattern_definitions = {}
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@patterns_files_glob = "*"
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@break_on_match = true
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@named_captures_only = true
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@keep_empty_captures = false
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@tag_on_failure = ["_grokparsefailure"]
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@timeout_millis = 30000
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@tag_on_timeout = "_groktimeout"
[2018-04-13T15:19:13,271][DEBUG][logstash.filters.grok ] config LogStash::Filters::Grok/@overwrite = []
[2018-04-13T15:19:13,272][DEBUG][logstash.filters.date ] config LogStash::Filters::Date/@match = {"datetime"=>"yyyyMMdd HH:mm:ss"}
[2018-04-13T15:19:13,272][DEBUG][logstash.filters.date ] config LogStash::Filters::Date/@target = "@timestamp"
[2018-04-13T15:19:13,272][DEBUG][logstash.filters.date ] config LogStash::Filters::Date/@id = "3988916c15c511ee38c321a06c6a3513310fb62327e17efd50461c75ce7c1226"
[2018-04-13T15:19:13,272][DEBUG][logstash.filters.date ] config LogStash::Filters::Date/@enable_metric = true
[2018-04-13T15:19:13,272][DEBUG][logstash.filters.date ] config LogStash::Filters::Date/@add_tag = []
[2018-04-13T15:19:13,272][DEBUG][logstash.filters.date ] config LogStash::Filters::Date/@remove_tag = []
[2018-04-13T15:19:13,272][DEBUG][logstash.filters.date ] config LogStash::Filters::Date/@add_field = {}
[2018-04-13T15:19:13,273][DEBUG][logstash.filters.date ] config LogStash::Filters::Date/@remove_field = []
[2018-04-13T15:19:13,273][DEBUG][logstash.filters.date ] config LogStash::Filters::Date/@periodic_flush = false
[2018-04-13T15:19:13,273][DEBUG][logstash.filters.date ] config LogStash::Filters::Date/@tag_on_failure = ["_dateparsefailure"]
[2018-04-13T15:19:13,273][ERROR][logstash.agent ] Failed to execute action {:action=>LogStash::PipelineAction::Create/pipeline_id:main, :exception=>"LogStash::ConfigurationError", :message=>"translation missing: en.logstash.agent.configuration.invalid_plugin_register",