This might be a basic problem. I have the error code of "invalid config" when i try to parse gz file into logstash.
Below is my config:
input {
file {
type => "gzip"
path => "/Users/yangyan/Desktop/log_file/s3_logs/2014/testpurchase_funnel.log.gz"
start_position => "beginning"
codec => "gzip_lines"
}
filter {
grok{
match => { "message" => "%{SYSLOGBASE} %{GREEDYDATA:message}" }
overwrite => [ "message" ]
}
json {
source => "message"
}
mutate{
rename => { "[purchase][source]" => "p_source" }
rename => { "[purchase][type_id]" => "p_typeId" }
rename => { "[purchase][content_id]" => "p_contentId" }
}
date{
match => ["date", "YYYY-MM-dd HH:mm:ss", "ISO8601" ]
timezone => "Europe/Dublin"
target => "date"
}
prune {
whitelist_names => [ "@timestamp", "app_id", "member_id", "locale", "date", "p_source", "p_typeId", "p_contentId" ]
}
}
output {
stdout { codec => rubydebug }
}
AND below is the error:
etched an invalid config {:config=>"input {\n file {\n type => "gzip"\n path => "/Users/yangyan/Desktop/log_file/s3_logs/2014/testpurchase_funnel.log.gz"\n start_position => "beginning"\n codec => "gzip_lines"\n} \n\n filter {\n grok{\n match => { "message" => "%{SYSLOGBASE} %{GREEDYDATA:message}" }\n overwrite => [ "message" ]\n}\n\n json {\n source => "message"\n}\n\n mutate{\n rename => { "[purchase][source]" => "p_source" }\n rename => { "[purchase][type_id]" => "p_typeId" }\n rename => { "[purchase][content_id]" => "p_contentId" } \n}\n\n date{\n match => ["date", "YYYY-MM-dd HH:mm:ss", "ISO8601" ]\n timezone => "Europe/Dublin" \n target => "date"\n}\n\n\n prune {\n whitelist_names => [ "@timestamp", "app_id", "member_id", "locale", "date", "p_source", "p_typeId", "p_contentId" ]\n} \n}\n\noutput {\n stdout { codec => rubydebug }\n}\n\n", :reason=>"Expected one of #, => at line 10, column 9 (byte 207) after input {\n file {\n type => "gzip"\n path => "/Users/yangyan/Desktop/log_file/s3_logs/2014/testpurchase_funnel.log.gz"\n start_position => "beginning"\n codec => "gzip_lines"\n} \n\n filter {\n grok", :level=>:error}