Created
February 9, 2017 08:38
-
-
Save DanielBerman/fa3c6cb1c6a64cace6cd8dc8f81ba66f to your computer and use it in GitHub Desktop.
.eb extension for Elastic Beanstalk to send logs to Logz.io with Filebeat
This file contains 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
files: | |
"/etc/filebeat/filebeat.yml": | |
mode: "000755" | |
owner: root | |
group: root | |
content: | | |
filebeat: | |
# List of prospectors to fetch data. | |
prospectors: | |
- | |
# Each - is a prospector. Below are the prospector specific configurations | |
# Paths that should be crawled and fetched. Glob based paths. | |
# For each file found under this path, a harvester is started. | |
paths: | |
- /path/to/log/file.log | |
fields: | |
logzio_codec: plain | |
token: <<<*** YOUR TOKEN ***>>> | |
fields_under_root: true | |
ignore_older: 3h | |
document_type: MY_LOG_TYPE | |
registry_file: /var/lib/filebeat/registry | |
output: | |
### Elasticsearch as output | |
logstash: | |
hosts: ["listener.logz.io:5015"] | |
ssl: | |
certificate_authorities: ['/etc/pki/tls/certs/COMODORSADomainValidationSecureServerCA.crt'] | |
commands: | |
1_command: | |
command: "curl -L -O https://artifacts.elastic.co/downloads/beats/filebeat/filebeat-5.0.1-x86_64.rpm" | |
cwd: /home/ec2-user | |
2_command: | |
command: "rpm -ivh --replacepkgs filebeat-5.0.1-x86_64.rpm" | |
cwd: /home/ec2-user | |
3_command: | |
command: "mkdir -p /etc/pki/tls/certs" | |
cwd: /home/ec2-user | |
4_command: | |
command: "wget https://raw.githubusercontent.com/cloudflare/cfssl_trust/master/intermediate_ca/COMODORSADomainValidationSecureServerCA.crt" | |
cwd: /etc/pki/tls/certs | |
4_command: | |
command: "/etc/init.d/filebeat start" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment