Skip to content

Instantly share code, notes, and snippets.

@0xKD
Last active February 15, 2017 10:25
Show Gist options
  • Save 0xKD/53a8b62b6450c828d01b60269ddaa6a5 to your computer and use it in GitHub Desktop.
Save 0xKD/53a8b62b6450c828d01b60269ddaa6a5 to your computer and use it in GitHub Desktop.
Logstash gzipped files recursively - elasticbeanstalk logs
input {
pipe {
command => "find ./path -type f -name *.gz -exec gunzip --to-stdout '{}' + "
}
}
filter {
grok {
patterns_dir => ["./patterns"]
match => [
"message", "%{TIMESTAMP_ISO8601:timestamp} - %{WORD:loglevel}: %{PLAINTEXT:text}",
"message", "%{COMBINEDAPACHELOG}"
]
}
date {
match => ["timestamp", "ISO8601", "dd/MMM/YYYY:HH:mm:ss Z"]
}
}
output {
elasticsearch { hosts => ["localhost:9201"] }
}
# contents of ./patterns/text:
PLAINTEXT [^$]+
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment