Last active
February 15, 2017 10:25
-
-
Save 0xKD/53a8b62b6450c828d01b60269ddaa6a5 to your computer and use it in GitHub Desktop.
Logstash gzipped files recursively - elasticbeanstalk logs
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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"] } | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# contents of ./patterns/text: | |
PLAINTEXT [^$]+ |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment